Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
lucastro_123
Contributor III
Contributor III

Question about SUMIF in QLIKView

Hello guys!!

 

    I'm new at QLIK View and i'm having difficulty to sum a quantity with conditions. Here's the thing:

QLIK_Question.png

 

I need to Sum all the collumn "Day to Day * Real" and divide that for the sum of the Real collumn. All that aggregate by the "Ano" collumns, the "Mês" column and the B and C collumn there in blank. All of that to appear in another collumn next to it. That would be (done in Excel):

 

QLIK Question2.png

 

I tried the 

Sum(Aggr([Day to Day * Real],Ano,Mês,B,C)) 

 

With no luck... It's just returns 0s...

Can anyone help me? 

Thanks a lot!!!

Labels (5)
1 Solution

Accepted Solutions
lucastro_123
Contributor III
Contributor III
Author

Sorry for the late reply my friend. 

Yes, it was a calculated dimension, but i was able to solve my problem using aggregate.

I used Aggr on all the sum( "day to day" x "real")

and then divided that aggr for the aggr  sum("real")

Using year, month and country for the dimensions in the aggr.

Thanks for all the replies and will have another problem in my next post that is a challenge one!

View solution in original post

14 Replies
agigliotti
Partner - Champion
Partner - Champion

maybe this:
Sum( TOTAL [Day to Day * Real] ) / Sum( TOTAL Real )

lucastro_123
Contributor III
Contributor III
Author

It didn't work... It returns null() values.

agigliotti
Partner - Champion
Partner - Champion

please first check if the fields names in the expression are correct.

lucastro_123
Contributor III
Contributor III
Author

yes, they are.

agigliotti
Partner - Champion
Partner - Champion

which are the actual table's dimensions and measures ?

lucastro_123
Contributor III
Contributor III
Author

Column "Ano" = Year (2019,2020)

Column "Mês"  = Month (1,2,3,4,5,6,7,8,9,10,12)

Column B = Information about the country (Ie: Blue, Red, Green)

Column C = The client (Ie: Russia)

 

Therefore the sum should be aggregate by the year (in this case 2020), by the month (4) and the Column C (Russia)

In other words i would be summing all the data from "Day to Day * Real" for the year of 2020, the month of 4 and the country of Russia, divided by the summing of all data from "Real" for the   year of 2020, the month of 4 and the country of Russia.

 

The Programed, Real,Day to Day and "Day to Day * Real"are expressions

agigliotti
Partner - Champion
Partner - Champion

try with this expression:
Sum( TOTAL <Year,Month,Country> [Day to Day * Real] ) / Sum( TOTAL <Year,Month,Country> Real )

lucastro_123
Contributor III
Contributor III
Author

Still not working... If i just put Sum( TOTAL <Year,Month,Country> [Day to Day * Real] )

which should bring me the result of the sum of the "Day to Day * Real" column aggregate by the year, month and country, it brings me "0" values.

sunny_talwar

Shouldn't it be

Sum(TOTAL <Year, Month, Country> [Day to Day] * [Real])