Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Leverage your QlikView investment to modernize BI – see how! Join Group
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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!!!

1 Solution

Accepted Solutions
Highlighted
Contributor III
Contributor III

Re: Question about SUMIF in QLIKView

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
Highlighted
Partner
Partner

Re: Question about SUMIF in QLIKView

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

Highlighted
Contributor III
Contributor III

Re: Question about SUMIF in QLIKView

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

Tags (1)
Highlighted
Partner
Partner

Re: Question about SUMIF in QLIKView

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

Highlighted
Contributor III
Contributor III

Re: Question about SUMIF in QLIKView

yes, they are.

Highlighted
Partner
Partner

Re: Question about SUMIF in QLIKView

which are the actual table's dimensions and measures ?

Highlighted
Contributor III
Contributor III

Re: Question about SUMIF in QLIKView

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

Highlighted
Partner
Partner

Re: Question about SUMIF in QLIKView

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

Highlighted
Contributor III
Contributor III

Re: Question about SUMIF in QLIKView

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.

Highlighted

Re: Question about SUMIF in QLIKView

Shouldn't it be

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