# New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Highlighted
Contributor

## Previous Month Expression

Hi All,

can you please help me to populate previous month values, for the below sample set of data

data set

 Qty Month 1 01-01-2018 2 02-02-2018 3 03-03-2018 4 04-04-2018 5 05-05-2018 6 06-06-2018 7 07-07-2018 8 08-08-2018 9 09-09-2018 10 10-10-2018 11 11-11-2018 12 12-12-2018

Thanks,

Gowtham

Tags (1)
14 Replies
Valued Contributor

## Re: Previous Month Expression

Put -1 after max month in your expression. You can use previous function as well.

Month minus previous month | Qlik Community

Valued Contributor III

## Re: Previous Month Expression

Num(Sum({<Month={"\$(=Max(Month)-1)"}>}Qty))

Let's do this:

Thiago Justen Teixeira Gonçalves
WhatsApp: 24 98152-1675
Skype: justen.thiago
Honored Contributor

## Re: Previous Month Expression

Try this

F:

load *,Year(Date) as Year, Month(Date) as Month;

Qty, Date

1, 01-01-2018

2, 02-02-2018

3, 03-03-2018

4, 04-04-2018

5, 05-05-2018

6, 06-06-2018

7, 07-07-2018

8, 08-08-2018

9, 09-09-2018

10, 10-10-2018

11, 11-11-2018

12, 12-12-2018

];

Previous Month Expression

=sum({<Year = {"=max(Year)"}, Month={"\$(=month(MonthStart(max(Date))-1))"}>}Qty)

Contributor

## Re: Previous Month Expression

Hi Shivesh,

Can you please provide me in expression without editing the script.

Thanks,

Gowtham

Contributor

## Re: Previous Month Expression

This expression showing 0 values

Contributor

## Re: Previous Month Expression

i tried with but its not showing the result

Num(Sum({Month={"\$(=Max(Month)-1)"}>}Qty))

Valued Contributor

## Re: Previous Month Expression

Sum({Month={"\$(=Max(Month),-1)"}>}Qty)

try this

Contributor

## Re: Previous Month Expression

I tried with same but still not result

Sum({Month={"\$(=Max(Month),-1)"}>}Qty)

Valued Contributor