Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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)
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)