Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
cbaqir
Specialist II
Specialist II

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
Taoufiq_Zarra

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

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉

View solution in original post

2 Replies
Taoufiq_Zarra

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

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
whiteymcaces
Partner - Creator
Partner - Creator

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 #])