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

help with set analysis and a conditional

I have to calculate the SUM(quantity1) - sum(quantity2) but without considering the field MONTH.

And in the other hand, if this expresion (SUM(quantity1) - sum(quantity2)) is <=0 i  don't wanna see it.

I think i did the first part what what i have to do to have that conditional?

Thank you all

Greetings.

3 Replies
Not applicable
Author

if((SUM(quantity1) - sum(quantity2)) is >=1,1,0)  write this in layout tab.

sum(quantity1)-sum(quantity2)   without cosidering month field means what?

Anonymous
Not applicable
Author

If (SUM({<Month=>}quantity1) - sum({<Month=>}quantity2) < 0 , null(), SUM({<Month=>}quantity1) - sum({<Month=>}quantity2))

JonnyPoole
Former Employee
Former Employee

With additions it may not make any difference to do it in one expression

if(    SUM( {$<MonthFieldName=>} quantity1- (quantity2)) >= 0 , SUM( {$<MonthFieldName=>} quantity1- (quantity2)) )


By not defining the ELSE condition it defaults to NULL and by default if you use this in a chart, the default setting on the presentation tab of the chart properties is to suppress nulls.


This will suppressing aggregates (by dimensional value) that are negative .