Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to sum the same field twice, but with different sum criteria in pivot tables?

What I am trying to do seems to be very easy, but I can´t figure out yet how to do it.

Supposing that I have the following dataset:

enter image description here

All I want is to see the sum of old sells and new sells, plus the percentage of difference. It would be:

enter image description here

But it seems that I can´t insert this % column in the pivot table.

If I put the data like this, I wouldn't have the % column.

enter image description here

So I was wondering if I can use the VALUE field twice, but for the first one tell it to only sum the values that are of type "Old" and for the second one only values that are of type "New"?

enter image description here

I didn't find anything in field options about criteria so I don't know if it's possible.

Oh, and I tried with Calculated Fields, something like:

=IF(OldNew = "Old", Value , 0) <-- For Old Values Sum.
=IF(OldNew = "New", Value , 0) <-- For New Values Sum.

But it didn't work either.

Thank you!

like image 335
Sawd Avatar asked Oct 30 '25 00:10

Sawd


1 Answers

Please try adding a Calculated Item named % with Formula:

=New/Old  

and formatting to suit.

like image 140
pnuts Avatar answered Nov 01 '25 13:11

pnuts



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!