Qlik Community

Qlik NPrinting Discussions

Discussion Board for collaboration on Qlik NPrinting.

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
qvelhoff
Valued Contributor

Re: How to presentate results of the last 3 months

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)

6 Replies
fernando_vizcai
New Contributor III

Re: How to presentate results of the last 3 months

Hi Guillermo,

Try this. Date should be a numeric date

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

Hope this helps.

Fernando

qvelhoff
Valued Contributor

Re: How to presentate results of the last 3 months

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)

Re: How to presentate results of the last 3 months

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

Dates in Set Analysis

Re: How to presentate results of the last 3 months

How about this?

Create one field like month(datefield) as Month,

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

Life is so rich, and we need to respect to the life !!!
Digvijay_Singh
Honored Contributor III

Re: How to presentate results of the last 3 months

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

Re: How to presentate results of the last 3 months

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

Community Browser