Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
margretand
Contributor
Contributor

MTD with set-analysis

Hi!

I am trying to create MTD (also YTD, QTD) for OrderQty using set analysis and defined variables.

I have a defined varriable, current date = 2008-06-30 (I also have variables for currentyear and so on)

The timedimension I get from the Order-Dates, which are in format: 2008-05-01 00:00.

This is the formula right now (below). With this i get the OrderQty for June (but june from all years aggregated, just want 2008). And I want this to change if I change current-date variable.

Anyone that can help?

Sum({$<[SalesOrderHeader.OrderDate.autoCalendar.Month]={"$(=Month($(CurrentDate)))"}>}OrderQty)

Labels (2)
1 Reply
sunny_talwar

May be add a set analysis for Year as well

Sum({$<[SalesOrderHeader.OrderDate.autoCalendar.Month]={"$(=Month($(CurrentDate)))"}, Year = {'2008'}>}OrderQty)

If 2008 is the max year in the app, you can also use this

Sum({$<[SalesOrderHeader.OrderDate.autoCalendar.Month]={"$(=Month($(CurrentDate)))"}, Year = {$(=Max(Year))}>}OrderQty)