Hi guys,
I am facing a trouble that I have a list of numbers:
List of Number (Integer) - 6 items
I need to split them to three array, and each array has 2 number values.
so it still going to be a list, which has 3 array, and each array has 2 values.
Can anyone can help me for this?
Discussion posts and replies are publicly visible
Try this example, where local!array is your initial list of integers, and local!childArrayLength is your desired size for the nested arrays:
a!localVariables( local!array: {10,20,30,40,50,60,70,80,90,100}, local!childArrayLength: 2, local!finalSize: ceiling(count(local!array)/local!childArrayLength), a!forEach( items: 1+enumerate(local!finalSize), expression: { reject( fn!isnull, index( local!array, if(fv!isFirst,fv!item,fv!item*local!childArrayLength-local!childArrayLength+1)+enumerate(local!childArrayLength), null ) ) } ) )
great minds think alike, i guess ;-)
Mike,
Actually I have already adapted a solution which you post in another question form.
It is working perfertly, thanks!
Was going to say! ;)