Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
PMF
Contributor II
Contributor II

Pivot Table Trick

Happy New Year to everyone!

I am new to this forum, and I hope you can help me with solving one problem.

We have a simple table containing positions across two dates, and a Pivot table with a fixed layout that compares those positions.
I am wondering if it's possible to add columns that display differences for each item between the dates (red arrows in the dummy table below).

Thank you in advance,
Best Regards
Peter

Capture.PNG

 

Labels (1)
14 Replies
Anil_Babu_Samineni

That is possible, If i understand correctly. Can you please share sample and expected outcome as in sketch?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
PMF
Contributor II
Contributor II
Author

Hello Anil, 

Thank you for your offer. I enclose two files, this is just atoy example. 

Best Regards

Peter

 

Anil_Babu_Samineni

Expected result? at least for 1 or 2 rows ?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
edwin
Master II
Master II

one way is to calculate the sum of the two fields in script, create a new field that defines which of the value fields it is: Val2, Val3 and the sum.

check out the attached

PMF
Contributor II
Contributor II
Author

Assuming addition operations 4+4=8 for val2, and 6+6=12 for val 3.

8+8=16, and 12+12=25 for the next row accrdingly. 

Thank you so much!

 

Regards

Peter

PMF
Contributor II
Contributor II
Author

Hello Edwin,
Thank you so much for your solution. Please correct me if I am wrong, but I think I tried to do exactly that in the last section of the pivot table's screenshot that I included in my original post.
I should have start with explaining the bigger picture as well, my bad. The bigger picture is to use multiple variables (say ~15), large and relatively complex data sets extracted from DB and use those in risk analytics.
As you can imagine complexity in this setup goes quite quickly up.
Where I'd like to stick those results is exactly where those red arrows point out.

Thanks and Regards
Peter

 

 

 

 

Anil_Babu_Samineni

Let me understand more, You mean like this?

2021-01-04 22_02_32-QlikView x64 - [C__Users_ansam3_Downloads_NEW.qvw].png

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
PMF
Contributor II
Contributor II
Author

This is exactly it!!!

All the surce data will come from a SQL database, the structre will be much complex.

 

Thank you so much!

Peter

Anil_Babu_Samineni

That won't be a problem, Even if it is compex it has some capable to do. PFA 

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful