# QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikWorld 2023, a live, in-person thrill ride. Save \$300 before February 6: REGISTER NOW!
cancel
Showing results for
Did you mean:
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:

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):

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)

• ### table

1 Solution

Accepted Solutions
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!

14 Replies
Partner - Master III

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

Contributor III
Author

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

Partner - Master III

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

Contributor III
Author

yes, they are.

Partner - Master III

which are the actual table's dimensions and measures ?

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

Partner - Master III

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

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.

MVP

Shouldn't it be

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

Community Browser