Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am using the some basic training exercises in the Sales Discovery app that comes with Qlik sense. I am trying to figure out how to calculate YTD, MTD, and QTD sales. Can anyone help?
Hey Sunny can you please help stalwar1
Can you share where exactly are you trying to do this and what exact issue you are running into?
Hi Mark,
you can refer following straightforward set expressions to calculate YTD MTD & QTD
YTD
= sum({< CalDate= {">=$(=Date(YearStart(max(CalDate))))<=$(=max(CalDate))" }, CAL_Week= , CAL_Quarter=, CAL_Month= >} Sales)
MTD
=Sum({<
CalDate= {">=$(=Date(MonthStart(Max(CalDate))))<=$(=max(CalDate))"},CAL_Week= ,CAL_Year=, CAL_Quarter=>}Sales)
QTD
=sum({<CalDate={">=$(=QuarterStart(max(CalDate)))<=$(=max(CalDate))"},CAL_YEAR=,CAL_Month=,CAL_Quarter=,CAL_Day=>}Sales)
Which training materials specifically are you using? QS 3.2 allows the creation of "Calendar Measures" by right-clicking the "Sales Amount" field in the Fields Assets. However, the Sales Discovery app that I have with 3.2 Desktop was not properly setup for this. Do you have the source files to be able to reload it?
-Rob