Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

pivot table partial sum problem

Hi,

I have a problem with partial sum. Say I have a dimention 1 call D1 and have two values: a,b. and I have one expression E whose value will depend on D1 value,for example:

if(D1='a',Sum(cost),if(D1='b',Sum(cost)*100,?????))

The partial sum will be incorrect. How to script the ???? part so that the partial sum will correct.

Thanks!

Dihui

1 Solution

Accepted Solutions
Not applicable
Author

Try This:

Sum(if(D1='a',cost,if(D1='b',cost*100)))

View solution in original post

7 Replies
Anonymous
Not applicable
Author

If using a straight table, Look at using the "Sum of Rows" as the expression total instead of the Expression Default.

If using a pivot table, look up the chapter.. think it's 24.3 in the QV Reference manual regarding Sum of Rows in pivot table.

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

     Instead of  ???? you can put 0. This will not effect on your partial sum.

     Hope this will help you.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

Hi Johannes,

Still do not find the solution. I am using pivot table. Maybe we read different manuals.....

-dihui

Not applicable
Author

Try This:

Sum(if(D1='a',cost,if(D1='b',cost*100)))

Not applicable
Author

Thanks Erika,

It works

Not applicable
Author

Hi Dihui,

Attached is a sample QVW... I included both method (Erika and Johannes)

The solution can be found in the QlikView 10 manual page 1362 (pdf page)

Not applicable
Author

Hi khim_hoe,

very cool, thanks very much!

-Dihui