Skip to main content
Announcements
Defect acknowledgement with Nprinting Engine May 2022 SR2, please READ HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to presentate results of the last 3 months

Hi,

Im trying to set up a report in Qlikview to present the results of the last 3 months. However I dont seem to get this working.

In another report where i'm presenting the last 6 weeks it works like this:

=sum( {$<Week = {$(=Max(Week)-5)}>} Revenues)

But when i replace week with month that doesnt work. Anyone got any idea's?

Thanks in advance.

1 Solution

Accepted Solutions
NickHoff
Specialist
Specialist

Add this to your calendar:

IF(monthstart(TempDate) = monthstart(today(),-3),1,0)  AS Previous3MonthIND,

Then in your set analysis add SUM({$<Previous3MonthIND = {'1'}>}Revenue)

View solution in original post

6 Replies
Anonymous
Not applicable
Author

Hi Guillermo,

Try this. Date should be a numeric date

sum({<Date={'>=max(Date)<=addmonths(max(Date),-5)'}>}Revenues)

Hope this helps.

Fernando

NickHoff
Specialist
Specialist

Add this to your calendar:

IF(monthstart(TempDate) = monthstart(today(),-3),1,0)  AS Previous3MonthIND,

Then in your set analysis add SUM({$<Previous3MonthIND = {'1'}>}Revenue)

sunny_talwar

See if this blog can help you move in the right direction:

Dates in Set Analysis

Anil_Babu_Samineni

How about this?

Create one field like month(datefield) as Month,

=sum( {$<Month = {'$(=AddMonths(Month)',-3)}>} Revenues

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Digvijay_Singh

Date field needs to be used, month won't work as its value is cyclic between 1-12, sometimes u may have situation like 1-3 = -2.

Not applicable
Author

Thank you Nick Hoff, this is exactly what I needed.