Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
hub
Contributor II
Contributor II

How to hide columns depending of the columns names / Pivot table ?

Hello, 

Anyone knows how to do that ?

I'm trying to mask or show the month depending of the year (show the month split for the current year but only show the total for next year). I guess that it can be done with a condition somewhere...

My columns has 2 fields "Year" and "Month", so I'm trying to customize the month field with "show column only if" but with no luck...

Any idea ?

Result expected : 

hub_0-1662563121426.png

 

Columns fields for the pivot :

hub_1-1662563201495.png

Settings of the "Months" columns, with total and trying to customize the "show the columns only if"....

 

 

hub_2-1662563266036.png

 

thanks !

 

 

Labels (1)
4 Replies
vinieme12
Champion III
Champion III

the show/hide condition will hide the entire dimension not values

You need to use a Calculated Dimension as below

Dim1: =Yearfield

Dim2: =Aggr(if(Yearfield=Year(Today()),Monthfield,'TOTAL'),Yearfield,Monthfield)

 

 

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
hub
Contributor II
Contributor II
Author

Hey Vineeth, thanks !

Sorry I didn't had a chance to review your answer before.

I just tested it and it works well, but now, I would like to hide the multiple "0" columns which makes no sense in that context : for example in the A22 columsn (which means actuals 2022) having the month is excellent; however I would like to hide 2023/2024/2025.

As I have several values, it duplicated uneeded columns without content...

any idea how to fix that ?

thanks for your great support !

Capture.PNG

Capture2.PNG

 "Year-Month" syntax :

=aggr(if(YearField<year(today())+1,MonthField & '  ' & YearFiled, YearField), YearField, MonthField)

 

vinieme12
Champion III
Champion III

Change to below

 "Year-Month" syntax :

=aggr(if(YearField<year(today())+1,MonthField & '  ' & YearFiled, '-'), YearField, MonthField)

 

Also under Add-Ons >> Data Handling >> Uncheck include zero values

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
hub
Contributor II
Contributor II
Author

Hello, thanks, I tried that & different combinations, it's still the same...

thanks for your help anyway