Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
tim_leijen
Contributor III
Contributor III

Sumif function

Hi Guys!

Just trying to figure out the sumif equivalent in Qlikview.

From the forum I understood, it's =sum(if(.....

However I'm having some difficulties. So my aim is to get the total Net Contribution (NETCN) per account group.

I've followed all the steps on the forum, but for some reason the formula isn't working. Anyone has an idea?

=sum(if([Account Group], sum({<GL_1={NETCN},Dimension={ACT}>}Data)))

10 Replies
tresesco
MVP
MVP

Take a straight table:

Dimension: [Account Group]

Exp: sum({<GL_1={NETCN},Dimension={ACT}>}Data)



If this is not what you want. Try to share a sample data and explain expected output against that.

tim_leijen
Contributor III
Contributor III
Author

Ah sorry, I'm trying to set up a waterfall so it needs to be in a graph. After figuring out the sumif function in Qlikview I'll add another sumif behind it, getting a standard rate per bottle sold

=sum(if([Account Group], sum({<GL_1={NETCN},Dimension={ACT}>}Data)))  /

sum(if([Account Group], sum({<GL_1={VOL},Dimension={ACT}>}Data)))

tresesco
MVP
MVP

What is your dimension in the chart? Could share your sample app?

MindaugasBacius
Partner - Specialist III
Partner - Specialist III

Have you tried using:

Sum({<GL_1={'NETCN'},Dimension={'ACT'}>}Data) / Sum({<GL_1={'VOL'},Dimension={'ACT'}>}Data)

tim_leijen
Contributor III
Contributor III
Author

waterfall.JPG

I have nothing yet, I'm trying to set up something similar as above

thevingo
Creator
Creator

Hi

I think its best to deal it in the Script

sumif in scripts

tresesco
MVP
MVP

Try to share the excel file so that we can work on it to help you.

tim_leijen
Contributor III
Contributor III
Author

Trying to send an excel file here, but doesn't work... ill try to see if I can add the sumif formula in the script

andrei_delta
Partner - Creator III
Partner - Creator III

Hi,

if you are trying to use "sum(if(" then the syntax is this: sum(if(condition,then, else))

in our case that syntax will be: sum(if(  GL_1='NETCN' and DIMENSION='ACT', Data))

if the if-clause is true then it will give as result the values from the field "Data" and then it will be sum(Data).


the other examples you have been given already are set analysis 


Hope it helps,

Andrew