Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
ehann2343
Contributor II
Contributor II

I want to filter out entries in my chart that don't fall between certain date range

I have a chart with entries that have a delivery date. I want to only show entries with a delivery date that falls between the first day of the current month (For example 10/1/2023) and the end of the next 3 months (For example 1/31/2024). 

Currently in my script I have these variables: 

let vTodayMonthStart = Date(MonthStart(Today()), 'MM/DD/YYYY');
let vTodayNext3mo = Date(MonthEnd(AddMonths(Today(), 3)), 'MM/DD/YYYY');

and my current attempt is an expression within the chart:
=Date([Delivery Date]) >= Date($(vTodayMonthStart)) and Date([Delivery Date]) <= Date($(vTodayNext3mo))


but it is not working. Anyone have a solution? 

Labels (1)
1 Solution

Accepted Solutions
ehann2343
Contributor II
Contributor II
Author

Realized I could just add the field that it was being filtered on as a dimension in the chart itself and hide the column.

View solution in original post

2 Replies
WaltShpuntoff
Employee
Employee

Make sure you have a calendar with MonthsAgo. This can be generated automatically with Autocalendar, or you can recycle that code and implement it in your calendar tables.

From there, you just need in your set analysis <MonthsAgo={0, '-1', '-2', '-3')}>

-ws

ehann2343
Contributor II
Contributor II
Author

Realized I could just add the field that it was being filtered on as a dimension in the chart itself and hide the column.