cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sharewatcher
Frequent Visitor

How do I specifically filter data

Hello,

 

this is the case; I have 200 unique names in my database (Amber, Angie, Arnold), All of these people have worked on various occasions, so for the whole year there are 1400 names in total in my access database (the names come up several times) but I would only like to see 200 unique names in the first screen of my powerapp, and then when I click Amber I only want to see her worked hours.

 

How can this be built in? thank you in advance.

 

Kind regards,

 

Willem

1 ACCEPTED SOLUTION

Accepted Solutions

Then please use the GroupBy function.  Something like this for the items of Gallery1:

GrouBy(EmployeeNames, "EmployeeFirstName", "AllItems")

Then you can use somethig like this for the last date:

Max(AllItems, Date)

Anyway, much explanation here

 

When you click and go the next screen, just set the Items of your gallery to:

Gallery1.Selected.AllItems

This will give you the best performance

 

View solution in original post

6 REPLIES 6
Meneghino
Community Champion
Community Champion

Hi @sharewatcher your issue is very clear and yes it can be built in, but the possible solutions depend on some details.

What type of column is it?  Lookup or text?

If you give the name of the table and column it will be easier to refer it in the proposed solution.

Hello Meneghino,

 

The name of the table is EmployeeNames and the name of the column, which is Text, is EmployeeFirstName.

 

Thank you in  advance.

The function that does what you need is Distinct. However this function is not yet delegated so applying it directly to the SharePoint source will yield a list of the unique names in the first 500 records of your 1400.  You can see the result with this;

Distinct(EmployeeNames, EmployeeFirstName)

Since you have relatively few records, then a solution could be to cache all 1400 records in memory (i.e. using a collection) and then using the collection in the above formula.

 

Please see my comment to this post for an idea of how to do that efficiently.

 

This will have the added advantage that whenever you use that table anywhere else in the app, performance will be very very fast.

thank you for the information,

 

This works well in shortening the list and making it able to open within the limit of 500 lines.

 

But how can we add the latest worked day from Amber to the first screen (so for example we can see only Amber in the first screen but we also would like to see her last day that she worked);

Amber | 29-12-2016 | 8 hours worked
Angie  | 28-12-2016 | 6 hours worked

and then whenever you click on the name Amber, it goes to the next screen outlining all the hours worked per day (so here you can see;

EmployeeFirstName |  Date            | WorkedHours

Amber                       |  29-12-2016 | 8 hours worked 
Amber                       | 26-12-2016  | 5 hours worked
Amber                       | 22-11-2016   | 8 hours worked

Amber                       | 21-11-2016   | 8 hours worked

The name of the columns are above the text.

Thank you in advance.

Then please use the GroupBy function.  Something like this for the items of Gallery1:

GrouBy(EmployeeNames, "EmployeeFirstName", "AllItems")

Then you can use somethig like this for the last date:

Max(AllItems, Date)

Anyway, much explanation here

 

When you click and go the next screen, just set the Items of your gallery to:

Gallery1.Selected.AllItems

This will give you the best performance

 

Thank you meneghino i will work further on this!

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (2,619)