Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
hopkinsc
Partner - Specialist III
Partner - Specialist III

Set Analysis help with >=<=

Hi all,

I can't get the following expression to work, can anyone see what i am doing wrong in the red text? The expression works without the red text included. 

Count({<isActive={'true'},MAX(num([Store Audit Date]))={'>=$(=num(YearMonth)) <=$(=num(MonthEnd(YearMonth)))'}, $(vSet_ExcludedTime), $(vSet_ExcludedProduct) >} _%Account)

1 Solution

Accepted Solutions
hopkinsc
Partner - Specialist III
Partner - Specialist III
Author

Thanks, although i am using the field, but the field has aggregation around it as i only want to use the MAX of the field. 

I think it will be easier for me to create the MAX(NUM(Date)) in the script and use the resulting field instead. 

Thanks

View solution in original post

8 Replies
pepecc
Contributor III
Contributor III

Maybe my answer is useless, but I would use " (double quotes) instead of ' (simple quote) to close the expression

hopkinsc
Partner - Specialist III
Partner - Specialist III
Author

Hi, thanks for your reply, unfortunately it doesn't help 🙂 I think the quotes are correct, i am getting a syntax error from the first curly bracket... 

pepecc
Contributor III
Contributor III

Maybe it is because you need a field on the left of the =. I have never used an expression on the left side of the = in set analysis. I think it needs to be a field, not an expression. I am pretty sure that this expression: MAX(num([Store Audit Date])) is not valid for the left side of = in set analysis. You need a field.

hopkinsc
Partner - Specialist III
Partner - Specialist III
Author

I think it might be that i am using MAX within the set analysis, can anyone confirm please? and if that's the reason, does anyone know how i can use the MAX(Date) within the set analysis?

pepecc
Contributor III
Contributor III

See this:

https://community.qlik.com/t5/Qlik-Sense-App-Development/Variables-in-Set-Analysis-Left-side-of/m-p/...

Here they say that you can not use expressions on the left side of = in set analysis. Just fields

miskinmaz
Creator III
Creator III

You need to use a field at the left side of the expr like:

Count({<isActive={'true'},someField={"=$(MAX(num([Store Audit Date]))={'>=$(=num(YearMonth)) <=$(=num(MonthEnd(YearMonth)))'})"}, $(vSet_ExcludedTime), $(vSet_ExcludedProduct) >} _%Account)

hopkinsc
Partner - Specialist III
Partner - Specialist III
Author

Thanks, although i am using the field, but the field has aggregation around it as i only want to use the MAX of the field. 

I think it will be easier for me to create the MAX(NUM(Date)) in the script and use the resulting field instead. 

Thanks

Brett_Bleess
Former Employee
Former Employee

Just wanted to toss in some other links that may be of some help on this one to others:

https://help.qlik.com/en-US/qlikview/April2019/Subsystems/Client/Content/QV_QlikView/ChartFunctions/...

https://community.qlik.com/t5/Qlik-Design-Blog/A-Primer-on-Set-Analysis/ba-p/1468344

The latter has additional post links at the bottom of the post...

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.