Hi,
I want to check if the status is Start/ In Progress or Completed.
1. if the list is {"Start"; "Start"; "Start"}, result would be Start
2. if the list is {"Start"; "In Progress"; "Start"} or any combination that the values are not the same, result would be In Progress
3. if the list is {"Completed"; "Completed"; "Completed"}, result would be Completed.
please help.
Thanks,
Discussion posts and replies are publicly visible
For this I am assuming the second #2 (#3?) should result in "Completed"? If so:
a!localVariables( local!list: {"Start","Start","Start"}, local!union: union(local!list,local!list), if( local!union="Start", "Start", if( local!union="Completed", "Completed", "In Progress" ) ) )
Hey Chris, I think it should be started only if all the statuses are started else it will be In-Progress.
a!localVariables( local!statuses: { "Completed", "Completed", "Completed" }, if( union(local!statuses, local!statuses) = "Start", "Start", "In-Progress" ) )
Unknown said:Hey Chris, I think it should be started only if all the statuses are started else it will be In-Progress.
My logic is under the assumption that the initial post intended to indicate {"Completed","Completed","Completed"}="Completed", instead of "In Progress" - we will need the OP to confirm.
Correct, Actually it will be like the way you said but don't know what OP is looking for.
For a more condensed version of my solution, assuming this is the intended result:
a!localVariables( local!list: {"Start","Start","Start"}, local!union: union(local!list,local!list), if( count(local!union)>1, "In Progress", index(local!union,1,null) ) )