Qlik Community

Qlik Sense Advanced Authoring

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

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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.  

1 Solution

Accepted Solutions
Highlighted
Contributor III
Contributor III

Re: Set analysis with variable input and field

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
Highlighted
Employee
Employee

Re: Set analysis with variable input and field

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

Highlighted
Contributor III
Contributor III

Re: Set analysis with variable input and field

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

Highlighted
Employee
Employee

Re: Set analysis with variable input and field

Great, glad it's working for you.