Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Set analysis on Actual day / MTD and YTD

Hi, I am trying to display a KPI with total net sales and I want to have it default in showing yesterday figures (as schedule job to be run every morning, so it latest sales number would be yesterday).

I also want to have an option in the filter to let user to choose from

Sales Day (Actual day)

MTD (Month to date)

YTD (YTD)

therefore for example today when opening the dashboard it should show the sales of 3/12/2018, and when user click sales day it's is showing sales of 3/12 only, MTD would be 1/12 - 3/12 and YTD would be 1/1 - 3/12.

Please kindly help how I can achieve this when using set analysis? You can imagine my data model is having 2 simple field as Date and Sales figure.

Thanks you very much in advance for your help

2 Replies
PradeepReddy
Specialist II
Specialist II

check the below link for MTD/YTD calculations...

https://community.qlik.com/t5/QlikView-Documents/YTQ-QTD-MTD-and-WTD/ta-p/1489245

 

For the default previous day, assign the Date field with the previous day date in  document properties--> Triggers--> on open --> Select in Field

chinnuchinni
Creator III
Creator III

mtd:

Sum({<Year=, Month=, Quarter=, Week=,, Date={">=$(=Num(MonthStart(Max(Date))))<=$(=Max(Date))"}>} Sales)

 

Ytd:

Sum({<Year=, Month=, Quarter=, Week=,  Date={">=$(=Num(YearStart(Max(Date))))<=$(=Max(Date))"}>} Sales)