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

Announcements
Streamlining user types in Qlik Cloud capacity-based subscriptions: Read the Details
cancel
Showing results for 
Search instead for 
Did you mean: 
YaRennik
Contributor II
Contributor II

Sorting Values in a variable input box - Default state = Second highest value

Dear Qlik Community,

 

I am using a variable input box.

 

My goal is to have it display Year.month and have it sorted descending.

The default state should be: Current Month -2 = I.E. In this month it should display March 2021

 

My approach was: Concat(Distinct([Month] & ' ' & [Year]),'|' ,-[Months ago])

But I cant figure out how to get the default state I want.

Any help is greatly appreciated 🙂 

1 Solution

Accepted Solutions
Qlik1_User1
Specialist
Specialist

@YaRennik Try this

MONTH(AddMonths('02/28/2021',-2)) & YEAR(AddMonths('02/28/2021',-2))

This will 122020 as output.

View solution in original post

3 Replies
Qlik1_User1
Specialist
Specialist

@YaRennik 

For defaulting month try this MONTH(TODAY())-2 & [Year].

And for selection in dashboard you can use Bookmark or  Action "Select in Field" option at Sheet level.

Hope this help!!

YaRennik
Contributor II
Contributor II
Author

This works - But as soons as it hits the cross over point from 2020 to 2021 for example, it doesn't do its job anymore.

Maybe there is another way? 

Qlik1_User1
Specialist
Specialist

@YaRennik Try this

MONTH(AddMonths('02/28/2021',-2)) & YEAR(AddMonths('02/28/2021',-2))

This will 122020 as output.