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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
m_perreault
Creator III
Creator III

YTD,QTD, MTD

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?

4 Replies
m_perreault
Creator III
Creator III
Author

Hey Sunny can you please help stalwar1

sunny_talwar
MVP
MVP

Can you share where exactly are you trying to do this and what exact issue you are running into?

md_qlikview
Creator II
Creator II

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)

rwunderlich
MVP
MVP

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

http://masterssummit.com

http://qlikviewcookbook.com