cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Community Champion
Community Champion

Re: How do I specifically filter data

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
Highlighted
Community Champion
Community Champion

Re: How do I specifically filter data

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.

Highlighted
Frequent Visitor

Re: How do I specifically filter data

Hello Meneghino,

 

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

 

Thank you in  advance.

Highlighted
Community Champion
Community Champion

Re: How do I specifically filter data

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.

Highlighted
Frequent Visitor

Re: How do I specifically filter data

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.

Highlighted
Community Champion
Community Champion

Re: How do I specifically filter data

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

Highlighted
Frequent Visitor

Re: How do I specifically filter data

Thank you meneghino i will work further on this!

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

Top Solution Authors
Top Kudoed Authors
Users online (9,622)