Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
wanyunyang
Creator III
Creator III

pivot table dynamic column name

I'm trying to change pivot table column name dynamically based on the Year filter. For example, if I filter 2018, the column name shows something like "2018 sales", if filter 2017, shows "2017 sales".

Is it possible to do so? Any advice helps. Thanks!

6 Replies
rafatashiro
Contributor III
Contributor III

Hello!

In the field Label u can put something like this:

=if(isnull(GetCurrentSelections(YearFieldName)), 'All Years Sales', YearFieldName & ' Sales')

wanyunyang
Creator III
Creator III
Author

Hello!

It's not working.

My label is like:

1.PNG

pivot table shows:

2.PNG

rafatashiro
Contributor III
Contributor III

Hm..

Try to use like that

=if(isnull(GetCurrentSelections(YearFieldName)), 'All Years Sales', Concat( DISTINCT YearFieldName) & ' Sales' )

wanyunyang
Creator III
Creator III
Author

It seems it will show whatever I put in the label.

rafatashiro
Contributor III
Contributor III

You have to paste the formula in the Field Label

Formula:

=if(isnull(GetCurrentSelections(YearFieldName)), 'All Years Sales', Concat( DISTINCT YearFieldName) & ' Sales' )

chart properties.jpg

wanyunyang
Creator III
Creator III
Author

I mean in qlik sense