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

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
Creator
Creator
Author

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
Creator
Creator
Author

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.

Lisa_P
Employee
Employee

Great, glad it's working for you.