cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
sharewatcher
Level: Powered On

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
Meneghino
Level 10

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
Meneghino
Level 10

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.

sharewatcher
Level: Powered On

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.

Meneghino
Level 10

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.

sharewatcher
Level: Powered On

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.

Meneghino
Level 10

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

sharewatcher
Level: Powered On

Re: How do I specifically filter data

Thank you meneghino i will work further on this!

Helpful resources

Announcements
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (10,228)