Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
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