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: 
SparkyMarky
Contributor
Contributor

Variable Input - Default Value?

Hi,

A request came from a client who wants to know if I can set default values for two Dashboard Bundle Variable Input objects. The dynamic values displayed are a range of months. For one variable input, I want to default it to the prior month, and for the other variable input, I want to default it to the current month. 

Thank you

Labels (1)
1 Solution

Accepted Solutions
SparkyMarky
Contributor
Contributor
Author

Hi again,

Thank you for your quick responses. I just got back to this project so sorry for a delayed response.

I ended up setting the variables in the load script. I found the max and 2nd max dates in the data and then did a LET = peek() of each and assigned these to the variables.

After the load, the variable objects were set correctly.

Regards,

Mark

 

View solution in original post

3 Replies
Lisa_P
Employee
Employee

This should be possible by defining your Variable from the window in the Asset panel using an expression beginning with = to ensure that this is defined to store this result.

balabhaskarqlik

In the variables, try like this:

For current month : Max(Month) or Maxstring(Month).

Previous month: Addmonths(Max(Month),-1) or Max(Month,2).

SparkyMarky
Contributor
Contributor
Author

Hi again,

Thank you for your quick responses. I just got back to this project so sorry for a delayed response.

I ended up setting the variables in the load script. I found the max and 2nd max dates in the data and then did a LET = peek() of each and assigned these to the variables.

After the load, the variable objects were set correctly.

Regards,

Mark