Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Leverage your QlikView investment to modernize BI – see how! Join Group
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Specialist
Specialist

Rolling 3 Months

I am trying to show only the last 3 months of data but it's not working. I believe it's because my date field is formatted like 'MMM-YYYY' but I cannot seem to figure out the right syntax to fix it. Any ideas? TIA!

count({<[EPIC_CAPACITY.QUEUE_MONTH]={">=$(= Date(AddMonths(Max(EPIC_CAPACITY.QUEUE_MONTH),-3))) <=$(=Max(EPIC_CAPACITY.QUEUE_MONTH))"}>} [EPIC_CAPACITY.Ticket #])

Labels (1)
1 Solution

Accepted Solutions
Highlighted
Specialist III
Specialist III

Re: Rolling 3 Months

attached New Version

=count({<[EPIC_CAPACITY.QUEUE_MONTH]={">=$(= Date(addmonths(Date(Max(date#(EPIC_CAPACITY.QUEUE_MONTH,'MMM-YYYY')),'MMM-YYYY'),-3),'MMM-YYYY')) <=$(=Date(Max(date#(EPIC_CAPACITY.QUEUE_MONTH,'MMM-YYYY')),'MMM-YYYY'))"}>} [EPIC_CAPACITY.Ticket #])

 

Capture.PNG

Regards,
Taoufiq ZARRA

View solution in original post

2 Replies
Highlighted
Specialist III
Specialist III

Re: Rolling 3 Months

attached New Version

=count({<[EPIC_CAPACITY.QUEUE_MONTH]={">=$(= Date(addmonths(Date(Max(date#(EPIC_CAPACITY.QUEUE_MONTH,'MMM-YYYY')),'MMM-YYYY'),-3),'MMM-YYYY')) <=$(=Date(Max(date#(EPIC_CAPACITY.QUEUE_MONTH,'MMM-YYYY')),'MMM-YYYY'))"}>} [EPIC_CAPACITY.Ticket #])

 

Capture.PNG

Regards,
Taoufiq ZARRA

View solution in original post

Highlighted
Partner
Partner

Re: Rolling 3 Months

In your chart, instead of using the calculated dimension use  EPIC_CAPACITY.CLASS_DAYS, which you have already created in the script and appears to have the sames values.

Next create 2 variables like:

vMaxMonth = Max(EPIC_CAPACITY.QUEUE_MONTH)

vMaxMonth_3 = Date(AddMonths(vMaxMonth, -2), 'MMM-YYYY')

Change your chart expression to:

Count({<[EPIC_CAPACITY.QUEUE_MONTH]={">=$(vMaxMonth_3) <=$(vMaxMonth)"}>} [EPIC_CAPACITY.Ticket #])