Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Problems with partial sum in a pivot table

Dear All,

I have a pivot table that shows data groups in rows, months in columns and "COUNT(TransactionNumber) * Price" in expression. When I check partial sum for months (columns) I get it right but when I check partial sum for data groups (rows) pivot doesn't show it.

I've put Price dim into SUM(Price) and got the partial sum but incorrect (att. screen shot).

Please advise how to fix it.

error loading image

BR,

Przemek

9 Replies
Not applicable
Author

Hi,

If your input data are transactionnal, just put Sum(Price) in the pivot table, you don't need to count the number of transaction.

jj

Not applicable
Author

The name "TransactionNumber" might be misleading - the whole formula counts number of records within a data group to multiply it by Price and get final cost. To sum up, COUNT(TransactionNumber) has to stay.

BR,

Przemek

Not applicable
Author

Hi Przemek,

I ran into a similar problem. My partial sum is correct for the dimension that I have used,

but the group of rows or the individual rows gives me different values. It seem they adjust

themselves based on the total.

Could you please suggest me what step should I take to come out of this issue?

Thanks and best regards,

Bikash

Not applicable
Author

did u guys solve this issue? I ran into similar situation

Sokkorn
Master
Master

Hi Przemek,

Can you attahced your report? Then we will try to find problem together.

Regards,

Sokkorn

SunilChauhan
Champion II
Champion II

coovert your pivot table into straight table

go to prroperties-> expression

-> select expression-.check sum of rows in place of Expression total

apply

and then again convert into pivot table

Sunil Chauhan
jonathandienst
Partner - Champion III
Partner - Champion III

Przemek

I suspect the problem is that Price is not unique for the total that it not working, so Price returns null and your sum returns zero. I have found in this case that an aggregate fixes the problem. Try something like

Sum(Aggr(Count(TransactionNumber) * Price, Month, DataGroup))

Hope this helps

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

Sunil, I tried it earlier but that didnt work

Not applicable
Author

John,

My case is something like

dimensions

If(condition is true,if(Condition is true, ( Tablecolumn)))

Month

Expression

=Count(stuff)+Count(Stuff)

// its actually a 2 line expression

i tried using ur eample

Sum(Aggr(Count(stuff)+Count(Stuff), Month,

If(condition is true,if(Condition is true, ( Tablecolumn)))))

but its showing '0'