Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hey guys, I'm new to Qlik and trying to make a variable button. I want to make past 7 days, MTD, QTD, YTD buttons.
I created a variable vDates how can I make an expression that controls the dates for my variable ReportingDate?
I know that for MTD I'll have to do something like MonthStart(Max(ReportingDate)) and something similar for QTD and YTD but I'm not sure how to get the range since this just gives me 1 value. Any help will be appreciated.
Hi @garyvary123,
Please go through with the below link
Hello,
1. Let your buttons store values in one variable (vVar). Like, Past 7 Days button will store 1 in vVar, MTD button will store 2, QTD will store 3 and YTD will store 4.
2. Now check if vVar is getting values as per the button selection.
3. Use Pick(), Match() function to pick measures as per the button selection.
E.g
Pick( vVar,
Sum({<Set for past 7 days>}Sales),
Sum({<Set for MTD>}Sales),
Sum({<Set for QTD>}Sales)
Sum({<Set for YTD>}Sales)
)
Thanks,
Ashutosh
Hey Ashutosh, thanks for this but I'm not looking for the Sum of some variables. A specific example of what I'm trying to do is convert a button that I've already made into a variable input so it looks prettier. For example:
I have a button with Action: Select values matching search criteria
Field: ReportingDate
Expression: ='>$(=YearStart(Max([ReportingDate])))<=$(=Max([ReportingDate]))
When I press this button it shows only YTD values which is perfect. I want to convert this into a variable input button so that it doesn't look as sloppy.
Hey Abhijit, I'm not looking for a sum of variables or something along those lines. I just want to select values matching a search criteria using variable input. Please see my reply to Ashutosh. Thanks