cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Resolver I
Resolver I

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
Highlighted
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.
Highlighted
Resolver I
Resolver I

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!
Highlighted
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.
Highlighted
Resolver I
Resolver I

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

Highlighted
Resolver I
Resolver I

Re: Distinct, Filter, Nested IFs

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

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

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

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (6,819)