Hi Everyone,
How can I get the data that more duplicate in a columns to put it to another columns?
I have an existing data collection.
and How can I put the highlighted data to the other columns that look like this.
Thank you and best regards,
Boynogs,
Solved! Go to Solution.
Hi @Boynog ,
Are you using a Table or a gallery?
The key of your requirement is to get the exactly value(for example, "Television"), if you get this value, you can then use this value to populate different columns. You can try below solution.
Add a button, set its OnSelect to below formula(or you can put this formula into the OnStart property of your app, remember to replace to the name of your DataSource):
ClearCollect(test1,Distinct(DataSource,Work));
ClearCollect(test2,ForAll(test1,CountRows(Filter(DataSource,Work=Result))));
Clear(Combined);
ForAll(
Sequence(CountRows(test1)),
Collect(Combined,
{
Work:Last(FirstN(test1,Value)).Result,
count:Last(FirstN(test2,Value)).Value
})
);
Set(var1,First(SortByColumns(Combined,"count",Descending)).Work)
This is the result of collection Combined:
This time, the needed value is saved in the variable "var1". If you are using a gallery, you can directly use var1 for different labels.
For example, I am using a gallery, I add a label and set its Text=var1:
And set another label to If(ThisItem.Work=var1,var1,"No Data"):
Best regards,
Allen
Hi @Boynog ,
Are you using a Table or a gallery?
The key of your requirement is to get the exactly value(for example, "Television"), if you get this value, you can then use this value to populate different columns. You can try below solution.
Add a button, set its OnSelect to below formula(or you can put this formula into the OnStart property of your app, remember to replace to the name of your DataSource):
ClearCollect(test1,Distinct(DataSource,Work));
ClearCollect(test2,ForAll(test1,CountRows(Filter(DataSource,Work=Result))));
Clear(Combined);
ForAll(
Sequence(CountRows(test1)),
Collect(Combined,
{
Work:Last(FirstN(test1,Value)).Result,
count:Last(FirstN(test2,Value)).Value
})
);
Set(var1,First(SortByColumns(Combined,"count",Descending)).Work)
This is the result of collection Combined:
This time, the needed value is saved in the variable "var1". If you are using a gallery, you can directly use var1 for different labels.
For example, I am using a gallery, I add a label and set its Text=var1:
And set another label to If(ThisItem.Work=var1,var1,"No Data"):
Best regards,
Allen
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
182 | |
52 | |
41 | |
40 | |
34 |
User | Count |
---|---|
251 | |
81 | |
71 | |
66 | |
66 |