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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
mishraamit2485
Creator
Creator

Set clear state on a variable

Hi All, Can we set a clear state on a button the action behind that button action behind that button is to select current month out of all the months.

Suppose I'm hitting clear button so this month its should go on Oct next month it should go on Nov.

Currently what is happening it is storing this month(Oct) when i'm setting the clear state where as next month also it is Oct only...i want something where it selects dynamic selection(Oct this month Nove next), instead of static (Stores Oct) only.

23 Replies
Anonymous
Not applicable

Hi Amit,

Max will return latest quarter.

Not applicable

Create a table with

Load Distinct

Quarter,

AutoNumber(Quarter,1) AS QuarterNum

resident xxxxxxQuarterTable;

left join it with xxxxxxQuarterTable.

then  in the set analysis use QuarterNum

Regards

John

mishraamit2485
Creator
Creator
Author

Hi Jhon,

Appreciate your help but I tried the above solution but it is in vain, if you see the attached app in the first post, its pretty clear what the requirement is.

cjohnson
Partner - Creator II
Partner - Creator II

Hi Amit,

Please see answer below:

Substitute for set clear state

Since you say the data is not driven by the system date -- it is instead driven from data coming in on the back-end -- you can set your variable "vCurrentQtr" to be based on data coming in on the back end instead.

For example you can do a resident load with the max quarter as follows:

MXQTR:

NOCONCATENATE

LOAD

  MAX(Qtr) as MXQTR

RESIDENT

DataSet1;

LET vCurrentQtr = peek('MXQTR',0,'MXQTR');

Thanks,

Camile