Qlik Community

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Tell us which business and trade publications you read most regularly: RESPOND NOW
Showing results for 
Search instead for 
Did you mean: 

MTD with set-analysis


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?


Labels (2)
1 Reply

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)