Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

wanyunyang
Contributor

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
New Contributor III

Re: pivot table dynamic column name

Hello!

In the field Label u can put something like this:

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

wanyunyang
Contributor

Re: pivot table dynamic column name

Hello!

It's not working.

My label is like:

1.PNG

pivot table shows:

2.PNG

rafatashiro
New Contributor III

Re: pivot table dynamic column name

Hm..

Try to use like that

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

wanyunyang
Contributor

Re: pivot table dynamic column name

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

rafatashiro
New Contributor III

Re: pivot table dynamic column name

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
Contributor

Re: pivot table dynamic column name

I mean in qlik sense

Community Browser