Qlik Community

Ask a Question

Qlik Sense Advanced Authoring

Discussion board where members can learn more about Qlik Sense Advanced Authoring.

Announcements
Join us March 10th, 7 Ways Modern Analytics Can Help You Take Smarter Action. REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
covenant_bi
Contributor III
Contributor III

Set analysis with variable input and field

Hello, I have a question about Set analysis and using variable input for dates and a regular filter pane with a date.  I'd like the user to be able to use the inputs for custom ranges or use the filter pane for picking 1-2 days. 

The date picker extension is wonky and adds a day to the range selected.  We are on Feb 2020 and it looks like Apr 2020 got the fix for this. So I don't want to use that.

Anyhow, my set analysis looks like this currently, using the "+" for an OR.  Using the input boxes works great, but the POST_DATE filter pane does nothing if the input boxes are empty.  

Sum({<POST_DATE={">=$(vStartDate)<=$(vEndDate)"}+<POST_DATE={'=$(GetFieldSelections(POST_DATE))'}>}AMOUNT)

Let me know your thoughts.  

Labels (3)
1 Solution

Accepted Solutions
covenant_bi
Contributor III
Contributor III

Hi Lisa,

 I tried that and found that it only respected the filter pane selection.

I did try Sum({<POST_DATE*={">=$(vStartDate)<=$(vEndDate)"}>}AMOUNT) and that worked.  It respected the inputs when present, otherwise the filter pane.

View solution in original post

3 Replies
Lisa_P
Employee
Employee

It's not necessary to do that. Try this:
Sum({<POST_DATE+={">=$(vStartDate)<=$(vEndDate)"}>}AMOUNT)

covenant_bi
Contributor III
Contributor III

Hi Lisa,

 I tried that and found that it only respected the filter pane selection.

I did try Sum({<POST_DATE*={">=$(vStartDate)<=$(vEndDate)"}>}AMOUNT) and that worked.  It respected the inputs when present, otherwise the filter pane.

View solution in original post

Lisa_P
Employee
Employee

Great, glad it's working for you.