Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
43918084
Creator II
Creator II

show column if works in one field but not another

I have created below Island table for Show Column If in a Pivot table dimension.

Selections:

LOAD * INLINE [

Dim Selections
ALN,
t1_CRR,
t1_stage,
CRRcheck,
StageChk,
ChkVar  ]

In each of the dimension, under Show Column If Box, my formula is as below

For field ALN,  --->=GetFieldSelections([Dim Selections]) = 'ALN'

For field t1_CRR --->=GetFieldSelections([Dim Selections]) = 't1_CRR'

Then I have created 2 pages with respective Alternative States and  [Dim selection] filter panes for each page.

Strangely, if I choose ALN, the field will appear in the pivot table on the right.  But when I include other fields, the ALN disappears.

Would appreciate some guidance on the trick with Show Column if.   Many thanks in advance.

Capture.PNG

 

1 Solution

Accepted Solutions
GaryGiles
Specialist
Specialist

When multiple selections are made in a filter, the GetFieldSelections returns a string with list of selected values separated by commas, so the string 'ALN' will no long match.

You can use the GetSelectedCount() function and match() and concat() to show/hide the column based on field selections.  Something like this:

=if(GetSelectedCount([Dim Selections]) >= 1 and match('ALN',$(=concat(chr(39)&[Dim Selections]&chr(39),',')))>=1,1,0)

View solution in original post

2 Replies
GaryGiles
Specialist
Specialist

When multiple selections are made in a filter, the GetFieldSelections returns a string with list of selected values separated by commas, so the string 'ALN' will no long match.

You can use the GetSelectedCount() function and match() and concat() to show/hide the column based on field selections.  Something like this:

=if(GetSelectedCount([Dim Selections]) >= 1 and match('ALN',$(=concat(chr(39)&[Dim Selections]&chr(39),',')))>=1,1,0)

43918084
Creator II
Creator II
Author

Thank you very much for giving me the solution immediately.  It really helps.