I have a table with two columns, a name and a numerical value. Based on the numerical value, I want to repeat the name that many times. Basically I’m trying to find a method to covert an array into a list based on a value in each row, essentially a ForEach() based on an adjacent value.
Convert this:
{item A, 1; item B, 3; item C, 1; item D, 2; item E, 2} into
Into this:
item A
item B
item B
item B
item C
item D
item D
item E
item E
Just a 5 minutes workaround, it can probably be cleaned easily
This is basically a double foreach function, You’ve got a master button that will activate a slider from 1 to the number of different you have, updating the main table. During this loop, it will also trigger each time an inline button that will add row, according to the number for each item.
Please check the open embed below for detailled formula and how I cut it, and let me know if it requires furthers explanations.
Once more for that kind of issue, I assume that your format is as suggested : “item 1, N1; item 2, N2; …”
Edit :
Master Button : that update the slider and trigger inline button
Well, this is even easier then
On this example table, create an inline button like mine, with something like (not in computer anymore) ForEach(Sequence(1,CountColumn),AddRow(ResultsTable,Name,thisRow.Name)
and activate each inline button with a Master Button that will run from 1 to the number of item (here are 5) ForEach(Sequence(1,DataTable.Count()),InlineButton)