Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi
i am showing current month vs last year same month
this code showing current month vs last month
sum({<FiscalPeriod={$(=max(Num(Month(Date(Today()))))),$(=max(Num(Month(Date(Today())))-1))}>}Customer)
i want to make sure the above code is correct and how to get last year same month
thanks
any help?
For this kind of comparisons, I always calculate a "MonthID" in the script:
(num(Year(Date))-1)*12 + Month(Date) as MonthID
In your expressions you can use afterwards:
Sum({$<MonthID = {$(=Max(MonthID)-12)} >} Amount) for month in previous year
Sum({$<MonthID = {$(=Max(MonthID))} >} Amount) for month in current year
Hope this helps
That expression executed today will show the sum of the 'Customer' field for Fiscal Period '9' and '8'
Can you upload a sample?
here it is
Following your expression for month vs month, year vs year should be:
sum({<FiscalYear={$(=max(Num(Year(Date(Today())))-1)), $(=max(Num(Year(Date(Today())))))}, FiscalPeriod={$(=max(Num(Month(Date(Today())))))}>}Customer)
if i want to display current month and last year month in two charts how to split the code?
thanks
it showing current month only
I'm not sure to understand the requirements.
I made some graphs in attached doc. Hope one of those is what you're searching