Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set analysis with date between

Hello, guys!

I have a problem with set analysis, I need to create an expression with the average of values for the period from January till Month picked by user in the filter.

I created and expression: AVG({<Month_Date={">=$(=Min({1}Month_Date))<=$(=Max(Month_Date)"},Month_name=>}(Bench_Data*Forecast)), but it's not working,

May be I have some syntax error?

Please help!

Sample app is attached

Labels (1)
4 Replies
marcus_sommer
MVP
MVP

You have a 1 within the set analysis which meant to ignore user selections. You need to remove it:

AVG({<Month_Date={">=$(=Min({1}Month_Date))<=$(=Max(Month_Date)"},Month_name=>}(Bench_Data*Forecast))

- Marcus

swuehl
Champion III
Champion III

There is just a closing bracket missing:

AVG({<Month_Date={">=$(=Min({1}Month_Date))<=$(=Max(Month_Date))"},Month_name=>}(Bench_Data*Forecast))

Not sure if the logic is correct since min Month_Date is Jan-14.

Not applicable
Author

Yes, You're absolutely correct. It's not right, I need to set as min date Jan-15.

How can I insert this condition in my Set analysis?

swuehl
Champion III
Champion III

Not sure, maybe like

AVG({<Month_Date={">=$(=Date(yearstart(today()),'MMM-YY'))<=$(=Max(Month_Date))"},Month_name=>}(Bench_Data*Forecast))