local!combinedCriteriaResults: a!flatten( { local!test1.criteriaResults, local!test2.criteriaResults, local!test3.criteriaResults, local!test4.criteriaResults } ),
Local variables show there is two items with the same criteriaCode. How can I remove one item and leave the other with the same code?
Discussion posts and replies are publicly visible
You can use union() Function, but can you tell me more about requirement .
a!localVariables( local!test1:{1,2,3,4}, local!test2:{1,2,3,4,5,6}, local!combined:a!flatten({local!test1,local!test2}), union(local!combined,local!combined) )
The requirement is to remove one of the duplicate items from the local!combinedCriteriaResults
Using union() and count() you can detect any duplicates. Then, for each item in the union, you can just pick a single item from the list. displayvalue() comes to my mind.
Question is, how do you decide which item to pick?