Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to display the previous month's data?

Hi,

In report, I have to show the months and the sales happened in the last month. Ex: for Sep2010, I have to show the sales of Aug2010.

My report should be like this:

Month Sales

Sep2010 Sales of Aug 2010

Oct2010 Sales of Sep2010

Nov2010 Sales of Oct2010

How to do this? [8-)]

10 Replies
Not applicable
Author

You can create a variable from Variable Overview and name ot var_prev_month and value (Month-1).

Then in your expression, you need to use a SET identifier so that when you select Sept'2010, it shows value for Aug'2010.... e.g.

sum



({<Month={"$(var_prev_month)"}>} Volume)

Not applicable
Author

hi

you can use avobe function

see the attached file

thank

zaman

Not applicable
Author

Thanks for your reply.

The above code will work when we select the month. But I don't have any selection on Month.

Any idea???

Anonymous
Not applicable
Author

Hi shans ,you can load the month field in edit script and create the list box month.

Not applicable
Author

Hi shan_bala,

I think you can try make the expression like this

sum({$<Month = {$(=month(addmonths(max(DateField), -1)))}>}Sales)

Hope this help,

Tatar.



Anonymous
Not applicable
Author

Hi shans , chek you can load the month in edit script and you create a list box month there you can select the month.

Not applicable
Author

hi

you can use this for last month also

sum

(If(MonthYear-1,SalesQty))

zaman

johnw
Champion III
Champion III

One way:

Month, Sales
Aug 2010, 50
Sep 2010, 60
Oct 2010, 75
etc.

AsOfMonth, Month
Sep 2010, Aug 2010
Oct 2010, Sep 2010
etc.

Dimension = AsOfMonth
Expression = sum(Sales)

Not applicable
Author

Thanks for your reply.

In the same table I need to show the month,sales on that month,sales on previous month without selecting any month on the report.

Please see the attached file.