Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi ,
In my data model, I have month and year combination field as
Year(Date) * 12 + num(Month(Date)) as [Month Counter], I want to calculate current month vs previous month values. So I have two expression as
current month
avg({<[Month Counter]={'$(=MAX([Month Counter]))'}>} xxx)
previous month
avg({<[Month Counter]={'$(vPreviousMonthCounter)'}>} xxx)
vPreviousMonthCounter as
vPreviousMonthCounter=max([Month Counter]) -1
Both the values for current and previous month are getting same, however it is not correct . Is my expression wrong or do I need to use it in different way.
Please suggest.
What is the value of =MAX([Month Counter] and vPreviousMonthCounter
MAX([Month Counter] returns 24219 , that is March and
vPreviousMonthCounter returns 24218 that is Feb.
you can use max(month) and max(month)-1 as well
you can use this expression for previous month
sum({<DT_LCL={"$(=date(max(DT_LCL)-1))"}>}CHRN_CT)
you can use this for max(month)
sum({<DT_LCL={"$(=date(max(DT_LCL)))"}>}CHRN_CT)
Try in double quotes once.
avg({<[Month Counter]={"$(=MAX([Month Counter]))"}>} xxx)