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

Distinct, Filter, Nested IFs

I am failry new to PA, so bear with me, but I am trying to get Distinct to work in conjunction with the following formula:

 

 

Filter
   (PtAColl,
       //The "No"s in the following are not actually in the data table (only "Yes"s are and anything not "Yes" is blank), but they serve the purpose of not returning the respective column if/when the control is not seleted
       If(ChkInt.Value=true,"Yes","No") in Interior || If(ChkExt.Value=true,"Yes","No") in Exterior,
       If(ChkClr.Value=true,"Yes","No") in Clear || If(ChkSol.Value=true,"Yes","No") in Solid || If(ChkOth.Value=true,"Yes","No") in Other
   )

 

 

To this point the formula is doing what I would expect it to do (resulting data output below), but I can't get Distinct to work.

 

I have tried a handful of ways and I can structure such that no errors, blue lines, etc. are returned, but no matter how I have tried to format it, the output is alwasy blank.

 

The data source is PtAColl and the formula above is being entered into DataTable1.items. I would like to make the ProdFam column distinct.

 

Thanks in advance. Would also ultimately like to Sort ProdFam too, but would be happy to just get Distinct to work at this point.

 

Capture.JPG

 

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Distinct, Filter, Nested IFs

When you use Distinct the result column is called "Result". If you go the table fields property you will see a field called "Result". Make sure that is checked so it shows in the table and that column should display the ProdFam distinct values.



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
6 REPLIES 6
Super User
Super User

Re: Distinct, Filter, Nested IFs

Distinct returns a single column table. If you use Distinct on ProdFam then that is the only column that will be returned and displayed in your table. 

 

Example: Distinct( PtAColl, ProdFam)



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
AGS94
Level: Powered On

Re: Distinct, Filter, Nested IFs

Actually that is exactly what I ultimately want. What do I need to do to display the single column table just so I can make sure things are working properly as I continue to flesh out this formula?

Thanks for the help and quick response!
Super User
Super User

Re: Distinct, Filter, Nested IFs

Just add "Distinct( PtAColl, ProdFam)" to the items property of the data table.



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
AGS94
Level: Powered On

Re: Distinct, Filter, Nested IFs

Understood, but I need to run the nested Ifs and Filter prior to running Distinct in order to get the results I need. That said, no matter how I try entering the Distinct, I cannot get it to show any data. So, for example, when I modify the previous formula (which is in the items property of the data table) as follows:

 

Distinct(
Filter
   (PtAColl,
       //The "No"s in the following are not actually in the data table (only "Yes"s are and anything not "Yes" is blank), but they serve the purpose of not returning the respective column if/when the control is not seleted
       If(ChkInt.Value=true,"Yes","No") in Interior || If(ChkExt.Value=true,"Yes","No") in Exterior,
       If(ChkClr.Value=true,"Yes","No") in Clear || If(ChkSol.Value=true,"Yes","No") in Solid || If(ChkOth.Value=true,"Yes","No") in Other
   ),
ProdFam)

I will not get any errors, blue lines, etc. but following is what my table shows. So prior to adding Distinct, the Filter/If commands are working as expected, but Distinct, Filter, Ifs are not playing nice with each other.

 

Capture.JPG

 

Super User
Super User

Re: Distinct, Filter, Nested IFs

When you use Distinct the result column is called "Result". If you go the table fields property you will see a field called "Result". Make sure that is checked so it shows in the table and that column should display the ProdFam distinct values.



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
AGS94
Level: Powered On

Re: Distinct, Filter, Nested IFs

Did not realize that. Thanks for all of your help.

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

PowerApps Monthly Community Call

Next Wednesday, August 21st at 8am PDT

Top Community Contributors for July 2019

Top Community Contributors for July 2019

Let's thank our top community contributors

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

FifthImage

Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

SixthImage

Power Summit Australia 2019

August 20-23rd 2019

Users Online
Currently online: 279 members 4,272 guests
Please welcome our newest community members: