Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to get the pevious month detail

Good Morning All,

I have a issue in getting the previous month data

For example the "Stement Date" which contains all dates of the year.

I wrote in the script as Month(Statment Date) as StMonth, for Year(Statement Date) as StYear.

What I need is I would like to get the previous month Statement date details like pressing the previous month button.

Can anybody know how to do this?

Regards

Joe

2 Replies
IAMDV
Luminary Alumni
Luminary Alumni

Good morning Joe.

Do you want to load previous month as additional field in the Load Script? I mean your StMonth field represents current montha and you wanted the StPreviousMonth? If this is what you need then you use something like this...

(Num(Month([Statment Date])) -1) AS StPreviousMonth

Good luck!

Cheers - DV

christian77
Partner - Specialist
Partner - Specialist

Hi:

You may want to do it using variables.

ActualMonth = max(Month)

LastMonth = max(Month)-1

and then:

sum({$<Month={$(ActualMonth)} >} Sales)

sum({$<Month={$(LastMonth)} >} Sales)