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: 
Anonymous
Not applicable

Using Set Expressions to limit Expression values

I have a bar chart, and I want to limit it to a 4-month sliding window, current month and three previous months.  I have assembled the following set expression via suggestions on here, but it does not filter at all.

Count ({1<date = {">=$(=MonthStart(AddMonths(Today()-3)))<=$(=MonthEnd(Today()))"}>} ticket_type)

My data essentially looks like this:

IDMonth-Yeardateticket_type

I am trying to accomplish something similar to this:

SKDATA.PNG

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

I have finally gotten this to work.

I used

Count({<[Month-Year] = {">=$(v3MonthsAgo)"}>}JOB_ID)

where

v3MonthsAgo

is defined as

LET v3MonthsAgo = MonthStart(AddMonths(Today(),-3));

View solution in original post

3 Replies
maxgro
MVP
MVP

maybe a missing comma in the AddMonths function

Count ({1<date = {">=$(=MonthStart(AddMonths(Today(),-3)))<=$(=MonthEnd(Today()))"}>} ticket_type)

Anonymous
Not applicable
Author

Well, not that ... lol now it is completely blank.  so I apparently have done something wrong

Anonymous
Not applicable
Author

I have finally gotten this to work.

I used

Count({<[Month-Year] = {">=$(v3MonthsAgo)"}>}JOB_ID)

where

v3MonthsAgo

is defined as

LET v3MonthsAgo = MonthStart(AddMonths(Today(),-3));