Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi guys,
Could you help me? I need to build a chart, where should months - the same month of last year and current 5 months.(dinamically)
Other words:
it should be in one chart Aug 2012, April 2013, May 2013, June 2013, July 2013, August 2013.
Thanks,
My formula works for me, see the attached file.
Hi,
Script
Num(Datefield) AS DateNum,
first you set current date like selectdate =Max(DateNum)
You need to calculate the six expression in charts, that is
Last year same month:
=(Sum({<Year=, DateBilledNum={'>=$(=(Num(MonthStart(AddYears(SelectedDate,-1))))<=$(=(Num(AddYears((SelectedDate),-1))))'}>}sumfield)
Previous Month of current year
=(Sum({<Year=, DateBilledNum={'>=$(=(Num(MonthStart(SelectedDate,-1)))<=$(=(Num(MonthEnd((SelectedDate),-1)))'}>}sumfield)
then you will reduce the -2,-3,-4,-5 then you will get the previous 4 months .
you will change the expression label also.
Regards,
It depends on your date field but if you want to use the MonthYear field (assuming that you used the MonthName() function to create it) you were describing and if you want to use only one expression I'd do the next:
SUM ( { $ < MonthYear={ " >= $(#=MonthName(Max(MonthYear),-4) <= $(#=MonthName(Max(MonthYear))) " , "$(=MonthName(Max(MonthYear),-12))" }, Year=, Month= > } YourField )
Hope it helps!
See the attached one
Something wrong with this expression
Count({<MYear={"$(='>=' & MonthName(Max(MYear),-4) & '<='& MonthName(Max(MYear))"}>} Var1)
Something wrong with this expression
Count({<MYear={"$(='>=' & MonthName(Max(MYear),-4) & '<='& MonthName(Max(MYear))"}>} Var1)
The expression works, but I can't get condinion more than last 4-5 months.
Count({<MYear={">=$(=MonthName(max(MYear),-4)"}>}Var1)
Hi,
Try like this
= Count({<MYear=,MYear={'>=$(=MonthName(Max(MYear),-4))<=$(=MonthName(Max(MYear))"}>} Var1)
Regards,
It's Ok, if I'll use only >=than last 4 months. (from last 4 months up to now).
I can'y add condition to this expression. If I use
Count({<MYear={'$(=MonthName(Max(MYear),-4))'}>}[Var1]) -----WORKS
More than 4 months -DOESN'T WORK
Count({<MYear={">=$(=MonthName(Max(MYear),-4))"}>}[Var1])
My formula works for me, see the attached file.