Hi ,
I have list of arrays coming from foreach, now i want unique elements for the list of arrays.
for example
localvariables(
local!arrays:foreach(
items:{5,6,7},
expresssion:enumerate(fv!item)+1
)
local!arrays
).
form this output, i want unique elements from the list of arrays.
can anyone help me in this?
intersection is working only for separate arrays stored in each local variable but not for arrays executed in foreach.
Discussion posts and replies are publicly visible
if you are looking for distinct values this could be the possible solution.
a!localVariables( local!arrays:a!forEach( items:{5,6,7}, expression:enumerate(fv!item)+1 ), rule!APN_distinct( a!flatten(local!arrays) ) )
Hi shoaib,
What's the code in rule APN_distinct()
Pretty sure it's just a wrapper function that uses union()
Hey Mathieu, that's correct it's just a union function. Using APN_distinct() just gives you a little flexibility to pass only one array rather than multiple if you are dealing with such kind of scenarios.