create an array with a multiple values
Hi. How can I create an array containing the outgoing values of a loop for?
7 replies
-
Can you elaborate?
Birger
-
Hi Birger.
I want to have access at the position of my data ( maybe using item() ) who are saved in "myData" with the for loop:if I use this:
------------------------------
let myData:=
for i in ... do
i
end
------------------------------"myData" is automatically an array or I need a different code to read each 'i' value through its index?
Thanks
-
"myData" in your example will be an array.
Birger
-
Thanks
-
Is there a way to sort the arrays? For example based on a selection from the table?
-
why not sort your selection before put them in a array?
let myArrayDataSelectedSorted := for i in (select Invoice[Status=2] order by Amount) do
i
end
-
if you use then
select
statement, you don't need to use the for-loop. Otherwise, the approach Robert posted would be the one I would use. One more point, the sort order using that approach will be ascending so if you want the sort to be descending you can use thersort()
function on the variable the array was assigned to.
Content aside
- 4 yrs agoLast active
- 7Replies
- 2932Views