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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Analysis

Why my below expression s not working???

Sum({<DataFlag = {'Plan'},

CalendarMonth = {"<=$(=Max(CalendarMonth))"},

CalendarMonth = {"$(=GetSelectedCount(CalendarMonth))>=1"}

>}Data)

I am getting the output 0 , even when i select the month.

Please help ............................

4 Replies
Not applicable
Author

What are you trying to achieve with this part?

CalendarMonth = {"$(=GetSelectedCount(CalendarMonth))>=1"}

If you are trying to only calculate the expression if 1 or more months are selected, then it should go in the Calculation Condition of your chart, or the Conditional box within the Expressions tab.

If you are using a version of QlikView prior to 11, then you will probably have to wrap your set expression in an If statement like this:

If(GetSelectedCount(CalendarMonth))>=1

     Sum({<DataFlag = {'Plan'},

     CalendarMonth = {"<=$(=Max(CalendarMonth))"}

     >}Data)

Not applicable
Author

Hi Michael

Thanks for your reply but i want that if conditon to be included my set expression .

Is that possible...i am using qlikview 10

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

Michael's expression should work fine in QV10 as well, as far as I can see.

Regards

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

Is there any reason that you want the condition inside the set exression?  Is it part of a more complex expression?

From my understanding of your requirement, putting an "If" around the Sum is more efficient and easier to read.