Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
aresb
Creator
Creator

Dynamic column swap in a table

Hi everyone

i'm trying to setup a dynamic column change based on a selection.

In my script editor i've this code for this 4 dimension

 

 

DateSelection:

LOAD * INLINE [
ID, DateString,
1, Monthly
2, Weekly
3, TimeFrame
4, Date
];

 

 

 Then, i have created the variable vDateSelection
= if(GetCurrentSelections(DateString) = 'Monthly', YearMonth,
if(GetCurrentSelections(DateString) = 'Weekly', Yearweek,
if(GetCurrentSelections(DateString) = 'Date', Date,
if(GetCurrentSelections(DateString) = 'Timeframe', cod_time_frame,
))))

after, i've inserted into the dashboard a box filter with the field DateString and the variable vDateSelection  as a column in the table with the sintax =(vDateSelection), but nothing change.

I can't understand where im doing wrong...does anyone can help ? 

 

 

Labels (3)
3 Replies
Digvijay_Singh

May be change things like this - 

Digvijay_Singh_0-1662122568181.png

 

Digvijay_Singh_1-1662122600566.png

 

Digvijay_Singh

Hope you already have single value selection implemented in DateString filter, else it wouldn't work. 

Just FYI GetCurrentSelections(DateString) returns value 'DateString: Monthly', so to extract 'Monthly' you would need subfield(GetCurrentSelections(DateString),':',2).

But as per my test you wouldn't need getCurrentSelections for this requirement.

aresb
Creator
Creator
Author

i managed with "GetFieldSelection". Thank you!