2 Replies Latest reply: Oct 25, 2013 3:35 AM by Brahma Arya

# compare current vs previous sales

Hello.

How can i compare the current sales vs previous sales giving only the current year date in the selections and the chart giving me also the previous sale date in the same period and in the same weekday. Also if i give the month compare automatically the sales in the previous year. Is there any set analysis to do this ?

• ###### Re: compare current vs previous sales

Hi,

Try like this

For Current Selections

=Sum(Sales)

For Previous Year

=Sum({<Year=, Month=, Quarter=,Week=,DateDimension={'>=\$(=YearStart(Max(DateDimension), -1))<=\$(=YearEnd(Max(Date), -1))'}>}Sales)

In the above expression replace DateDimension with your date field name, Year with Year field etc.  Year= is used to ignore the selections.

Regards,

Jagan.

• ###### Re: compare current vs previous sales

Hi

for previous year

sum({<yearfield={"=\$(=only(yearfiled)-1)"},quarterfiled=,monthfield={"=\$(=max(monthfiled)-1)"}>}sales)

if month is in monthnames then use month number function.