cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AGS94
Level 8

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.

View solution in original post

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 8

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 8

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.

View solution in original post

AGS94
Level 8

Re: Distinct, Filter, Nested IFs

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

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (4,464)