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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
poojashribanger
Creator II
Creator II

Dynamic Max Date through Script

how to get dynamic value in variable.

below code will give me static value but i want my variable to change with respect to date selection.

Temp:

Load

Max(dt) as MaxDate

Resident table_name;

Let vMaxDate = date(Peek('MaxDate',0,'Temp'));

LET vM1=date(yearend('$(vMaxDate)',-1,4),'MMM-YYYY');

LET vM4=date('$(vMaxDate)','MMM-YYYY');

LET vM3=date(monthstart('$(vMaxDate)')-1,'MMM-YYYY');

LET vM2=date(AddMonths(monthstart('$(vMaxDate)'),-2),'MMM-YYYY');

load * inline [

Timeline

'$(vM1)'

'$(vM2)'

'$(vM3)'

'$(vM4)'];

please help.

1 Solution

Accepted Solutions
RonaldDoes
Partner - Creator III
Partner - Creator III

That is fundamentally impossible, since at the time of reload, there is no way of knowing the selection the users are going to make when they eventually open the app.

View solution in original post

3 Replies
RonaldDoes
Partner - Creator III
Partner - Creator III

Hi Poojashri,

In that case you wouldn't want to define your variable in the script. After all, these only get updated once, during reload.

You'll have to add the variable in the Variable Editor in the frontend.

Naamloos.png

Please find attached example.

Hope this helps you.

With kind regards,

Ronald

poojashribanger
Creator II
Creator II
Author

i want to achieve this through backend

RonaldDoes
Partner - Creator III
Partner - Creator III

That is fundamentally impossible, since at the time of reload, there is no way of knowing the selection the users are going to make when they eventually open the app.