Hi People.!
One question.
I have one Entity that have a lot of records. The information is the next
colum1 column2 column3
PC1 PACO IVAN
PC2 PACO MARTIN
PC3 IVAN PACO
PC1 PACO IVAN
PC2 PACO MARTIN
I must show a gallery with all different records but colum1 without repetition. Therefore I have 2 PC1 and 2 PC2, so I should to show one of each.
I found the distinct functions but with this function i can show just one column. I need to show the 3 colums but not show duplicated for colum1
thank you
Solved! Go to Solution.
Hi @Anonymous :
My method is similar to @mdevaney 's , the principle is to construct a new column/table that contains the value of Column1/2/3, and then deduplication. Finally, split the column again with split function.The difference of my method is to use concatenate and forall to build new table directly.
Set the gallery's items preperty to:
ForAll(
Distinct(
Concatenate(
yourdatasource.column1,"##",yourdatasource.column2,"##",yourdatasource.column3),
Result
),
{
column1: Last(FirstN(Split(Result,"##"),1)).Result,
column2: Last(FirstN(Split(Result,"##"),2)).Result,
column3: Last(FirstN(Split(Result,"##"),3)).Result
}
)
Best Regards,
Bof
@Anonymous
Here's my take on the problem. You could try to store the records with non-duplicate records inside a Collection
ClearCollect(myUniqueRecords,
DropColumns(
AddColumns(
Distinct(
AddColumns(
your_datasource_name,
"CombinedColumns",Column1&";;"&Column2&";;"&Column3
),
CombinedColumns
),
"Column1",First(Split(Result,";;")).Result,
"Column2",First(FirstN(Split(Result,";;"),2)).Result,
"Column3",Last(Split(Result,";;")).Result
),
"Column1"
"Column2",
"Column3"
)
);
I built the solution using this example from my website. If you're having trouble visualize the solution it might help
https://matthewdevaney.com/powerapps-collections-cookbook/unique-records-in-a-collection/
---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."
Hi @Anonymous :
My method is similar to @mdevaney 's , the principle is to construct a new column/table that contains the value of Column1/2/3, and then deduplication. Finally, split the column again with split function.The difference of my method is to use concatenate and forall to build new table directly.
Set the gallery's items preperty to:
ForAll(
Distinct(
Concatenate(
yourdatasource.column1,"##",yourdatasource.column2,"##",yourdatasource.column3),
Result
),
{
column1: Last(FirstN(Split(Result,"##"),1)).Result,
column2: Last(FirstN(Split(Result,"##"),2)).Result,
column3: Last(FirstN(Split(Result,"##"),3)).Result
}
)
Best Regards,
Bof
User | Count |
---|---|
252 | |
126 | |
104 | |
50 | |
49 |