Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
P_Kumar
Contributor II
Contributor II

'Show if' condition box in Pivot Table

Hi,

I am using QS Sep'2018 Enterprise version.  I am using a Pivot table and I have scenario to show and hide based on the selection in filter conditions.  Following is code I am using which is working when I select only one value from filter but not for multiple values.  I mean when I select one 'Flag' value it's displaying but when I select multiple values like 'PB' and 'AC', it's not showing any values.  Kindly advise.  Thank you.

in 'Show if' condition box for First measure:

IF (GetSelectedCount(Flag)>0 and GetFieldSelections(Flag)='PB',1,0) 

in 'Show if' condition box for Second measure:

IF (GetSelectedCount(Flag)>0 and GetFieldSelections(Flag)='AC',1,0) 

 

Labels (2)
1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

Just use this for the condition

Index(GetFieldSelections(Flag), 'PB')

Index(GetFieldSelections(Flag), 'AC')

Index return zero for a non-match and non-zero for a match. GetSelectedCount is redundant.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

2 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Just use this for the condition

Index(GetFieldSelections(Flag), 'PB')

Index(GetFieldSelections(Flag), 'AC')

Index return zero for a non-match and non-zero for a match. GetSelectedCount is redundant.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
P_Kumar
Contributor II
Contributor II
Author

Fantastic!!  Worked well... Thanks a lot