Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I need two buttons for MTD and YTD in Qliksense, if i select MTD the data in the dashboard should be filtered for MTD. if i select YTD, the data should be filtered for YTD.
Could you please help me with the expressions for YTD and MTD.
Thanks in Advance.
Hello
Try something like this in your set analysis for YTD : Date = {" <= $(=Date(AddYears(Max(Date),-1))) "}
It should work.
I can try with you data if you can send me the qvf and I can send it back to you
Regards
Antoine L
expression is throwing error
@s4ni9r ,
You will need to create a bridge between the button and your expression using variable, You can try setting variable values on button press and check variable value in expression to activate either MTD or YTD expressions.
If you are using default qliksense button, you can find 'Set Variable Value' option under add action.
Regards,
Aditya
i need the expression for MTD and YTD variables
Can you please share an example of your data ?
Thanks
Can you share sample data so that I can get an idea of the data format ?
Regards,
Aditya
i have date column in the filter which shows date from 1,2,3,4,5,6 and month column as filter which shows values Jan, Feb, March.. and year column as Filer which shows values 2021,2022,2023..
Now my requirement is to have a MTD and YTD button, if i click on the MTD button the data which is in a pivot table should be filtered for MTD.
if i click YTD button, the data in the pivot table should be filterd for YTD.
Assuming that
- you have a date column date_col
- you use day(date_col), month(date_col), and year(date_col) as the fields for the filter
Then you may be able to use expressions as follows based on your MTD/YTD variable
MTD
sum({1<date_col= {"<=$(=date_col)>=$(=MonthStart(date_col))"}> } sales)
YTD
sum({1<date_col= {"<=$(=date_col)>=$(=YearStart(date_col))"}> } sales)
I would need the expression to be written in the MTD button, not on the chart