Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Sonalbjr
Contributor
Contributor

Qlikview

I am trying to use If and sum function while uploading data in qlikview .

The expression that I am using is 

If([xyz]= 'abc', sum([pqr]), 'NA')

 

But its showing an error. How to use summation inside if statement in qlikview script?

2 Replies
JuanGerardo
Partner - Specialist
Partner - Specialist

Probably you want:

Sum(If([xyz]= 'abc', [pqr]))

JG

duchezbr
Contributor III
Contributor III

Because sum is an aggregation function, you may need to use Group By [xyz] in your load script. 

Test:

Load

  [xyz]

  If([xyz]='abc', sum([pqr]))

Resident OriginalTable

Group By [xyz];