Qlik Community

Qlik DataMarket Discussions

Discussion Board for collaboration regarding Qlik DataMarket.

nehapathak
New Contributor II

Dynamic Column name

I want to change the name of columns in table as per the filter changes

eg In filter pane I have 4 values Q1, Q2, Q3 and Q4

The columns in the table are like-

If I select Q3 as quarter from filter pane then columns should be like-

Previous year        Previous quarter Q2        Current Quarter Q3

and

If  I select Q4 as quarter from filter pane then columns should be like-

Previous year    Previous quarter Q3    Current Quarter Q4

and data in the table should  change accordingly.

7 Replies
felipedl
Valued Contributor III

Re: Dynamic Column name

Hi Neha,


See the attached QVW as an example.

Felipe.

nehapathak
New Contributor II

Re: Dynamic Column name

Hi Felip

Can you pls send the qvf file of the same as I am using qliksense

sahadevpatil
New Contributor III

Re: Dynamic Column name

Hi,

I have used Variable expression as follow

vQuarter=GetFieldSelections(Quarter)

and

Current Quarter => ='Current Quarter ' & $(vQuarter)

Previous quarter  => ='Previous quarter ' & left($(vQuarter),1) &' '& (right($(vQuarter),1)-1)

see following snapshot

Dynamic_Column.PNG

download following attchment.

nehapathak
New Contributor II

Re: Dynamic Column name

thanks sahadev, your solution is helpful

what I am looking for is that in the previous quarter only those value should come which are below the current quarter.

For example if you select Q4 in current filter Q1,Q2 and Q3 should be visible in the previous filter

pradosh_thakur
Honored Contributor II

Re: Dynamic Column name

can you give some sample data and expected results which will help us help you better and faster.

regards

Pradosh

Learning never stops.
nehapathak
New Contributor II

Re: Dynamic Column name

ex-

There is a column quarters in our data having following values:

Q1

Q2

Q3

Q4

We are considering two filters current and previous. The following values should be displayed

Current filter                            Previous filter

value Q2                                      Q1

value Q3                                     Q2,Q1

value Q4                                      Q3,Q2,Q1

sahadevpatil
New Contributor III

Re: Dynamic Column name

Hi,

In my previous post only change following

Previous quarter=>> (Column expression)

if(right([Previous quarter],1)< right($(vQuarter),1),[Previous quarter])

its work fine

Regards

Sahadev

Community Browser