Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Current Date minus 13 month

Hello -

I am struggling with writing an expression that would display current month (as a default selection) and then the formula would need also subtract 13 month.

My Dimensions are:

  • Time_Period (2014-01, 2014-02 etc)
  • Measure: Sales 

Please help!

Thank you

2 Replies
jaimeaguilar
Partner - Specialist II
Partner - Specialist II

Hi,

you'll have to adapt to your dimensions but it could be something like this:

sum({$<MonthYear = {'$(=Monthname(today(), -13))'}>}Sales)

besides you'll need to ignore in set analysis any time field that could interfere in the calculation (specially if these fields are visible to end users) like: date=, month=, year=, week=, quarter= and so on

regards

MK_QSL
MVP
MVP

=SUM({<MonthYear = {">=$(=Date(AddMonths(Date#(Max(MonthYear),'YYYY-MM'),-13),'YYYY-MM'))<=$(=Date#(Max(MonthYear),'YYYY-MM'))"}>}Sales)