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: 
markperrone
Contributor III
Contributor III

Condiitonal aggregation

I'm have the following

LOAD

dimension,

IF(condition,SUM(field),NULL()) AS aggfield

RESIDENT table

group by dimension

 

getting an expression error.

Labels (2)
2 Replies
Sohan_Patil
Contributor III
Contributor III

Hi,

I think you get the same expression error as below for script. I am using measure sales in condition.

Error:

Sohan_Patil_1-1699456695591.png

 

script:

Sohan_Patil_0-1699456658878.png

If condition is changed to sum(Sales) as below it will work 

Sohan_Patil_2-1699456826691.png

 

 

vincent_ardiet_
Specialist
Specialist

Maybe like this:

LOAD

dimension,

Sum(IF(condition,field,NULL())) AS aggfield

RESIDENT table

group by dimension