Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Fernando_Sanchez
Partner - Contributor III
Partner - Contributor III

Calculate pivot table result based in previous value

Hi all, 

firt of all thanks a lot in advance for any future answer.

I am struggling quite a lo with obtaining a result within a pivot table based in previous value.

For example, I have this table:

Every month I have a certain decrease of a figure.

month pct
m01 1%
m02 2%
m03 3%
m04 4%
m05 5%
m06 6%
m07 7%
m08 8%
m09 9%
m10 10%
m11 11%
m12 12%

And what I am looking for is to obtain this output:

month pct output
m01 1% 99,00%
m02 2% 97,02%
m03 3% 94,11%
m04 4% 90,35%
m05 5% 85,83%
m06 6% 80,68%
m07 7% 75,03%
m08 8% 69,03%
m09 9% 62,82%
m10 10% 56,53%
m11 11% 50,32%
m12 12% 44,28%

 

Where output is the rest of the inventory (in pct) available.

For example:

m01 value is 100% decreased by 1% --> 1* (1-0,01) --> 99.

m02 value is 99% decreased by 2% --> 0,99 * (1-0,02) --> 97,02.

m03 value is 97,02% decreased by 3% --> 0,9702* (1-0,03) --> 94,11.

And so on.

I have been playing with above, before and others, but i am not capable of finding the answer.

Thanlk a lot in advance!

Regards.

 

2 Replies
Fernando_Sanchez
Partner - Contributor III
Partner - Contributor III
Author

Anybody?

I am sure this cannot be so hard, but I am really struggling.

Thanks a lot in advance.

Fernando_Sanchez
Partner - Contributor III
Partner - Contributor III
Author

ok, I finally come up with the solution

The value for the second colum is

=if(month='m+00',1-pct,Alt(Above(output),0)-(pct*Alt(Above(output),0)))

 

Now. Once I have the value calculated, I want to put into a text box the first value to be above 50%.

But I am struggling to do so, as I do not have any clue about how "to extract" it from its pivot table.

Thanks a lot in advance.

Regards!