# QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

## 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

1 Solution

Accepted Solutions

## 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

2 Replies

## 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

Not applicable

## 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