Hey everyone!
This is my first question here. I hope I’m doing things right, if I’m not, please tell me and I’ll do my best to fix it
Basically, I’m trying to adjust the repeating group columns regarding of the number of elements that are ranked in that number.
Because a picture is worth a thousand words (from a non-native English speaker) :
This is what the dashboard in duolingo looks like. Some rows have three elements, some have two, some have one.
Where I am :
→ I have a data type called “Program”. Each program has a name, picture, and order associated (the rest is not relevant to the issue here).
→ I want, in the case where there are two/three items with the same order, to be able to divide the column.
I’ve searched and everything I’ve tried didn’t work out as I expected.
My last idea was using the group by option, but I can’t figure out how it’s working.
Thanks everyone for the time you’ll spend helping me,
Gautier
One potential way to go would be to have two repeating groups.
Add a vertical repeating group, inside that repeating group add a horizontal repeating group.
You do need to keep track of both row and column in your data.
Amend your “Program” thing with e.g. Column and Row and use those to show only items for the specific row in your horizontal repeating group.
Hope that helps.
Change “Program” and instead of “order”, use row and column ?
So, how can I pick only the distinct elements that have the same row to fill the vertical RG ? Because I can see how to fill the horizontal one (Do a search of Programs and add the constraint of “where row = current cell’s program’s row”).
But how can I ensure that I’m selecting only the first one that has the same row?
The only idea I have is to add a constraint “column = 1”. But I think your idea was actually much more simpler. I have the feeling of going super far ! haha
One way I’ve used before when trying to make things faster is to load the entire thing once, put that result into a Custom State and then let the repeating groups show that custom state object with :filter applied as appropriate.
Doing lots of database reads tend to take a lot of time.