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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
jerryr125
Creator III
Creator III

Pivot Table - Sum Issue

Hi - 

I am having an issue with a pivot table.  

I have the following as Dimenions:

Category

Sub Category

Cost Group

PO-Line Number

 

For the Measure I have the following:

=sum((abcamount))

 

The measure (sum)  is adding up all the line numbers multiple times and the results are not accurate.

 

Any thoughts on a fix to this issue ? 

Thanks - Jerryr

Labels (2)
7 Replies
sk88024
Creator
Creator

Provide some sample data please, as well what should be the expected output. It's hard to comment based on the information in your question.

Helga_W
Employee
Employee

If frontend chart expressions aren't yielding the correct result, this is often resulting from a problem in the data model, e.g. with wrong joins causing.

For debugging, put the data in question into a table and see if you are getting wrong or correct sums there.

jerryr125
Creator III
Creator III
Author

Hi - Example of Data - 

I would suspect the pivot table provide me the same output with the ability to expand/collapse.

I think error is in the sum(abcamount)

Therefore when Expand Category 1, Sub Category 1, Cost Group A it should

display:

1

   1

     A

       1-1 10000

       1-2 20000

        1-3 22000

 

Category | Sub Category |  Cost Group |  PO Line Number | abcamount

1 |1  | A |1-1 | 10000

1 | 1  |A |1-2 |20000

1 | 2  |A |1-3 |22000

1 | 2  |A |1-1 |35000

1 | 3 | A |1-3| 58000

sk88024
Creator
Creator

Just loaded the data you've provided, and this is what I am getting in a pivot table. Still don't understand what exactly you're looking for though. 😃

Also, I don't see that the measure is adding up all the line numbers multiple times,

or you're referring to Total rows? 

sk88024_0-1744030785786.png

 

 

jerryr125
Creator III
Creator III
Author

Hi - 

Thank you for your assistance.

Yes, that is what I should be getting, but instead, I am getting something like:

1

   2

      A

         1-1   30000

          1-2 30000

 

 

For some reason it is summing the values to the last level.

 

IN the measure I have sum(abcamount)

 

Does Not make sense....may a different measure formula?

jerryr125
Creator III
Creator III
Author

Hi - 

I am still stuck on this issue - any thoughts ? Jerry

sk88024
Creator
Creator

Hi

I think you should check your data values using a table... and pull all the required columns as dimension. See if you're getting the correct data there. 

If you are using a pivot table and sum(abcamount) as measure, then you should get the same result as the one from my screencap in my previous reply. But if you don't then, check your data... something is definitely not right in your data.