3 Replies Latest reply: Nov 5, 2015 3:38 PM by Ana Aparicio

# How to compare this year and last year's sales data

Hi,

I am trying to do an expression to compare this year vs last year's sales data. Below is the formula that I am using. It showuld say in percentage.

=IF(MONTH(INVOICEDATE) > MONTH(TODAY()), 0, (SUM(IF(YEAR(INVOICEDATE) = YEAR(TODAY()), INVOICEAMOUNT, 0))/ SUM(IF(YEAR(INVOICEDATE) = YEAR(TODAY())-1, INVOICEAMOUNT, 0))) -1).

But, it is showing 0 for everything. Can anyone please assist me on this?

• ###### Re: How to compare this year and last year's sales data

The As-Of Table described in the recent blog post by Henric could give you inspiration for a good alternative solution.

• ###### Re: How to compare this year and last year's sales data

or may be this, always Henric

Year-over-Year Comparisons

• ###### Re: How to compare this year and last year's sales data

If you are doing the expression in a chart you can use set analysis:

sum({<Year={"=\$(=Year(Today()))"}>})/sum({<{<Year={"=\$(=Year(Today())-1)"}>} INVOICEAMOUNT)