2 Replies Latest reply: Sep 1, 2014 10:17 AM by saurabh kabra

# How I show the month one year before

Hello togehter,

I have the formula sum({\$<Nature={Actual}>}Amount)

How get a Formula, that I get the Amount of the month one year before.

Thank you.

Jörn

• ###### Re: How I show the month one year before

Hi,

For current and previous year

Current Year Sales

=Sum({<Year = {'\$(=Max(Year))'},Nature={Actual}>} Amount)

Previous Year Sales

=Sum({<Year = {'\$(=Max(Year)-1)'},Nature={Actual}>} Amount)

Have a look at below post too.

http://community.qlik.com/message/479161#479161

Regards

ASHFAQ

• ###### Re: How I show the month one year before

If you have order date, then calculate

1. month

2. year

Sum({<year={\$(=max(year)-1)},month={"=\$(=max({<year={\$(=max(year))}>} month))"},

ORDER_DATE={"<=\$(=max(ORDER_DATE))", Nature={Actual}}>}(Amount))

So, It will calculate sales for current month in previous year as we have used max(year)-1 and it will calculate it upto the order date selected.

Respond if doubt exists.

Cheers Saurabh Kabra