Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
twills12
Contributor III
Contributor III

Need help with date range logic.

Hello.  I have an application that needs to show counts based upon the date the user selects.  They can select a single month from the list box and the displayed counts should reflect that selected month's values.

The source data has a begin and end date on the records, so I want counts where the user selected month falls between these two date fields.

TeamCountBegin DateEnd Date
A17/1/20196/30/2020
B111/11/201911/11/2020

 

In this example, for Team A, I would want the count to reflect '1' if the user selects a date between July 2019 and June 2020, but anything before July 2019 for Team A would be '0' and anything after and including July 2020 would be '0'.

My attempts with set analysis isn't working.  The count doesn't change when I switch in and out of that range.

=count({<DisplayDate = {">=$[Begin Date] <=$[End Date]"} >} [Team Name])

1 Solution

Accepted Solutions
Kushal_Chawda

try below

 

=count({<DisplayDate = {"=DisplayDate >=[Begin Date] and DisplayDate <=[End Date]"} >} [Team Name])

View solution in original post

1 Reply
Kushal_Chawda

try below

 

=count({<DisplayDate = {"=DisplayDate >=[Begin Date] and DisplayDate <=[End Date]"} >} [Team Name])