Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a small problem and I was wandering if anyone could help me. I've looked other threads, but couldn't solve it.
For selected year total sales KPI I created this expression:
Sum({$<OrderDate.autoCalendar={Year}>}Sales)
Now I'm having trouble doing it for the previous year total sales KPI that I want to put next to the first one.
How do I do it?
Thanks in advance.
Previous year:
Sum({<[OrderDate.autoCalendar.Year] = {"$(=Max(Year(OrderDate)) - 1)"}>} Sales)
Current year:
Sum({<[OrderDate.autoCalendar.Year] = {"$(=Max(Year(OrderDate)))"}>} Sales)
It will be based on your selection to get what is the lastest(max) possible year, and minor 1 to get its previous year.
I agree with Jerry Jackson on solution: Sum({$<OrderDate.autoCalendar.YearsAgo={1}>}Sales)
Why dont it work?
@
Try:
Sum({$<OrderDate.autoCalendar.YearsAgo={1}>}Sales)
Thanks Jerry for the answer, but it doesn't work.
Prior Year:
Sum({<Year=,OrderDate={">=$(=YearStart(MakeDate(Max(Year)),-1))<=$(=YearEnd(MakeDate(Max(Year)),-1))"}>}Sales)
Current Year:
Sum({<Year=,OrderDate={">=$(=YearStart(MakeDate(Max(Year))))<=$(=YearEnd(MakeDate(Max(Year))))"}>}Sales)
Thanks again Jerry, but still nothing.
Previous year:
Sum({<[OrderDate.autoCalendar.Year] = {"$(=Max(Year(OrderDate)) - 1)"}>} Sales)
Current year:
Sum({<[OrderDate.autoCalendar.Year] = {"$(=Max(Year(OrderDate)))"}>} Sales)
It will be based on your selection to get what is the lastest(max) possible year, and minor 1 to get its previous year.
I agree with Jerry Jackson on solution: Sum({$<OrderDate.autoCalendar.YearsAgo={1}>}Sales)
Why dont it work?
@
Thanks Phi, your solution worked, no idea why Jerry's didnt
Thanks a lot to both of you.
Cheers
Hello guys,
I am solving same issue I believe, but I can't find right solution. Can you help me? . This works correctly "Sum(Invoice_item_converted_price)" if I select date Service_generated_datetime.autoCalendar.YearMonth.
I want to show in table also previous year sales for selected YearMonth, but it doesn't work
Sum({<[Service_generated_datetime.autoCalendar.Year] = {"$(=Max(Year(Service_generated_datetime))-1)"}>} Invoice_item_converted_price)