Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
dineshm030
Creator III
Creator III

YTD with multple Dimesions

Hi All,

I am calculating YTD with two dimension. I am using RangeSum and Above function. I am struggling in Above function. Kindly help me.

Expression:

RangeSum(Above(sum({<IMSMonthName,IMSYear,DATAPERIOD={">=$(=date(AddYears(YearStart(date#(max(DATAPERIOD),'YYYYMM')),-1),'YYYYMM'))<=$(=date(addyears(date#(max(DATAPERIOD),'YYYYMM'),-1),'YYYYMM'))"}>}NVALUE)/1000000,9,RowNo()))

I have hot coded 9. How to achieve this instead of hot coded by month.

Regards,

Dinesh Kumar Mani.

1 Reply
tresesco
MVP
MVP

If 9 here indicating month number one less than today's month, you could define a variable and use it in the expression like:

vPreMonth=Num(Month(Today()))-1


Then replace your hard coded number with $(vPreMonth)