6 Replies Latest reply: Jul 12, 2018 2:16 AM by Igor Banjac

# KPI comparison current year vs previous year

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?

• ###### Re: KPI comparison current year vs previous year

Try:

Sum({\$<OrderDate.autoCalendar.YearsAgo={1}>}Sales)

• ###### Re: KPI comparison current year vs previous year

Thanks Jerry for the answer, but it doesn't work.

• ###### Re: KPI comparison current year vs previous year

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)

• ###### Re: KPI comparison current year vs previous year

Thanks again Jerry, but still nothing.

• ###### Re: KPI comparison current year vs previous year

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?

@

• ###### Re: KPI comparison current year vs previous year

Thanks Phi, your solution worked, no idea why Jerry's didnt

Thanks a lot to both of you.

Cheers