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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
amars
Specialist
Specialist

Macro to hide a column when a field is selected in a cyclic group

Hi all,

I am having a pivot, for me the requirement is , in a group if a particular Field is selected then it should show me 3 column's else for other field's it should show me only 2 column's hiding the extra column. Does anyone have any way to do that (using macro is also ok).

Thanks in advance.

With Regards

Amar

4 Replies
sparur
Specialist II
Specialist II

Hello.

I don't like to use a macro, so I would suggest you other approach.

you can create 2 charts: one with 3 columns and other with 2. And use show conditional options on the Layout tab in chart properties. And show condition is:

getcurrentfield( myGroup ) = 'Customer' (for example)

field Customer must be a part of group 'MyGroup'

and for second chart: getcurrentfield( myGroup ) <> 'Customer'

johnw
Champion III
Champion III

In 9.0 you should be able to do it with only one chart by putting the condition on the presentation tab for that column.

amars
Specialist
Specialist
Author

Hi John,

I saw the presentation tab, but I don't find anything where I can put a conditional expression. Do u have any example or can u describe how to do that please. Thanks a lot.

With Regards

Amar

sparur
Specialist II
Specialist II

Hello, Amar.

As John said, in 9.0 you can show/hide a column, BUT it works not all types of chart. In pivot it doesn't allow. For example, in straight table it can be done.