Hello everyone
We have a requirement where we must group repeated values in a table, that is, as seen in the image, the name of a user appears 3 times, how to make it only appear once
Discussion posts and replies are publicly visible
The absolute simplest way there is to remove duplicates: union(local!list, local!list)
For other operations, such as counting the number of times duplicated, that might take quite a bit more effort. Only one kind of solution is below:
a!forEach( items: union(local!list, local!list), expression: concat( fv!item, ": ", length( wherecontains(fv!item, local!list) ) ) )
Wherecontains spits out an index number for every time specified value appears in specified array, so if it's at position 5, 10, and 12, output is {5,10,12}. So the length of that output is the number of times that value appears in the array. You remove duplicates in the items definition so you don't have "Steve:5, Steve:5, Steve:5, Jeff: 1, Steve:5, Steve:5".
Thank you very much for your answer, how could I relate each user with its corresponding value? For example I need to assign the corresponding user: James: 4,5,6 Jeff: 1,2,3 Mike: 7,8,9Currently the values come out like this: Santiago: 1,2,3,4,5,6,7,8,9 Jeff: 1,2,3,4,5,6,7,8,9 Mike: 1,2,3,4,5,6,7,8,9
Hi Mike, apparently the image did not upload correctly. The data is consulted through record types and displayed in a grid
The question is how could I assign the values of the "Importes" column to the "Directores" column as appropriate
Currently the values come out like this:
For example:
James: 1,2,3,4,5,6,7,8,9
Jeff: 1,2,3,4,5,6,7,8,9
Mike: 1,2,3,4,5,6,7,8,9
and i need something like that
James: 4,5,6
Jeff: 1,2,3
Mike: 7,8,9
schavez said:assign the values of the "Importes" column to the "Directores" column
I guess what i'm unclear on here is what the basis of the "assignment" is supposed to be? Do the items have some sort of inherent relationship due to the DB, or are you just hoping to evenly split up the "importes" evenly between the different "directores"?
Yes, the data is related by the DB
schavez said:Yes, the data is related by the DB
What is the relationship / how is it stored in the DB? What's the data structure?
Based on the output in your initial sceenshot my concern is that it's either not being stored correctly in the DB, or not being queried correctly for use on the form. But I can only make guesses as to the data structure based on that screenshot.