QUESTION 1> Suppose we have 1 array : local!arr : {a,b,b,c,c,c,d,d,d,d}. Then how we will print in the pattern like
a,
b,b
c,c,c
d,d,d,d.
QUESTION 2>Suppose we have 2 - arr1: {"apple","banana","mango"}, arr2:{"a","b","c"}.
How we will print if we choose "a" then it should print "apple" , if we choose "b" then it should print "banana" , if we choose "c" , it should print "mango".
Discussion posts and replies are publicly visible
Hi pd0001, for your first question my solution would be below,
a!localVariables( local!arr : {"a","b","b","c","c","c","d","d","d","d"}, a!forEach( items: union(local!arr,local!arr), expression: joinarray(repeat(fv!index,fv!item)) ) )
and for your second question , you can use the latest function a!match() to achieve what you want.
Hi gopalk, I am still not able to solve 2nd problem when i am choosing input from 2nd array via rule input then it should print from array 1.
Hi, in simple way you can implement like this, there are other methods as well like creating decision table . Check your use case and then decide the approach.