Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
ashish_2511
Creator
Creator

Pivot Table - Incorrect Partial Sums

Hi There

I'm using a three dimensional pivot table shown below-

Capture.PNG

Here's the expression i'm using to calculate Cost of actual readings (OMR) -

Column(2)*(

If(

  network_node_type='City',

  Sum(

  {<[MRBC Cost]={'Number of actual readings'}>} [Unit_Cost (City)]

   )

    ,

  (Sum(

  {<[MRBC Cost]={'Number of actual readings'}>} [Unit_Cost (Rural)]

   )

   

   

  )))

*network node type is the 3rd dimension and column(2) is not in the snip above(It's towards left)

The partial sums are incorrect. please help.

Labels (1)
1 Solution

Accepted Solutions
sunny_talwar
MVP
MVP

You can try like this:

Sum(Aggr(<Replace Column(2) with the actual expression here> *

If(network_node_type='City',

  Sum({<[MRBC Cost]={'Number of actual readings'}>} [Unit_Cost (City)]),

  Sum({<[MRBC Cost]={'Number of actual readings'}>} [Unit_Cost (Rural)])), Year, Month, [Connection Type]))

View solution in original post

2 Replies
sunny_talwar
MVP
MVP

You can try like this:

Sum(Aggr(<Replace Column(2) with the actual expression here> *

If(network_node_type='City',

  Sum({<[MRBC Cost]={'Number of actual readings'}>} [Unit_Cost (City)]),

  Sum({<[MRBC Cost]={'Number of actual readings'}>} [Unit_Cost (Rural)])), Year, Month, [Connection Type]))

ashish_2511
Creator
Creator
Author

Wow! Thanks a ton Sunny.. That worked...

Regards

-Sneh