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

Set analysis for date range made of 2 date variables

Hi,

I have 2 variables set up as start and stop date named:

vStartDate

vEndDate

I want to set up a date range limitation via set analysis to be used on a chart so that the chart will only display data for the range between these 2 dates.

I managed to set up the vEndDate limit but i can't figure out how to add the second condition (vStartDate). Can you please help me with the syntax?

This is my set analysis with the EndDate condition which is working:

Sum({$<Date={"<$(vEndDate)"}>}Sales)

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Try adding an equal sign in front of your vStartDate variable definition:

=Date(Addmonth(Today(),-1))

or

Sum({$<Date={">$(=Date(Addmonth(Today(),-1)))<$(vEndDate)"}>}Sales)


I assume, that your default date format is 'DD/MM/YYYY', otherwise add the date format to Date() function.

View solution in original post

4 Replies
swuehl
MVP
MVP

Sum({$<Date={">$(vStartDate)<$(vEndDate)"}>}Sales)

Anonymous
Not applicable
Author

Thanks Stefan but the syntax does not change the date range as I wanted it to.

Here are my variables:

I have a feeling this has to do with the way I defined the vStartDate...?

My table looks like the below. with the added set analysis expression It currently ends on 31/07/2017 but starts on 31/07/2016. I want it to start from a month before today's date (e.g. 20/12/2016)

swuehl
MVP
MVP

Try adding an equal sign in front of your vStartDate variable definition:

=Date(Addmonth(Today(),-1))

or

Sum({$<Date={">$(=Date(Addmonth(Today(),-1)))<$(vEndDate)"}>}Sales)


I assume, that your default date format is 'DD/MM/YYYY', otherwise add the date format to Date() function.

Anonymous
Not applicable
Author

Thanks Stefan! Adding a "=" at the beginning of the variable did the trick!