Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
sorrakis01
Specialist
Specialist

Show and Hide columns in a Pivot Table

Hi,

Can I show and hide columns in a pivot table in the same expression?

Ex:

Dimension Year (2010,2011,2012,2013,2014)

Expresion 1 Sales (values for all the years)

Expresion 2 Budget (only contains values of 2014)

In the pivot table:

I like to hide the column Bugdet for 2010,2011,2012,2013.

Is it possible? when all the years are selected?

Thx

7 Replies
alex_millan
Creator III
Creator III

Hi Jordi,

I've got the same doubt. I can hide an expression setting  a condition, but it hides the expression for all the existing values of the dimension.

I doubt if there's any way to hide/show an expression only for some values of the dimension.

Cheers,

ashwanin
Specialist
Specialist

Hi,

1) You need to display only 2014 Budget value always?

2) What value you required if you select 2013 or 2012,2013 in Year?

sorrakis01
Specialist
Specialist
Author

Hi Ashwani,

1) Yes

Years2011201220132014
ClaseSalesBudgetSalesBudgetSalesBudgetSalesBudget
C983973190119472660012919297304503054059282337
E16065660117127606760180198444300860
F15861210018861575013406133051020016591374
J58740760809066406449241037654342427444
T3134487025712000990952060894351485
113585744010881713012994230061348905529503
2185472950131859550173619900515542265891

I like this,  without the column budget in the years 2011,2012 and 2013.

Thx.

lironbaram
Partner - Master III
Partner - Master III

hi

sorry but you can't hide columns just for some values of the diemnsion

it either shows on all values or hidden for all values in pivot table

Not applicable

Hi,

Try something like this for the budget expression. This will give the budget value only for 2014 year when u select all the year or if nothing is selected (no selection in a field implies everything as selected). If anyother year is selected it will give the budget value for that specific year.

=if(getSelectedCount(year)=5 or GetSelectedCount(year)=0,sum({<yeah={2014}>}budget),sum(budget))

sorrakis01
Specialist
Specialist
Author

Hi preethi,

Doesn't work.

Not applicable

I have attached the sample which works - qv result.qvw. Please check. Please note this works only when u select everything or nothing. If you seelct a particular yr or a combination of years other than everything it will not.

There is another samle qv result1.qvw which works when u select everything or nothing and also any combination of 2014 with other yrs. But if select only other years without including 2014 then it gives you the values for other years.

This expr is:

=if(GetFieldSelections(year) like '*2014*' or GetSelectedCount(year)=0,sum({<year={2014}>}budget),sum(budget))