Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
krishna20
Specialist II
Specialist II

Difference Between two columns in Pivort Table

Hi Friends,

I need to find the difference between two columns in pivort table.

My requirement is like

Year                     2014                                                     2013                                     2014 -2013

Product     

               Payment             Recovery                 Payment         Recovery            Payment           Recovery

A                100                        200                     150                      120                  -20                         80

B                 200                         50                       100                     100                  100                       -50

C                 400                        200                      100                       200                 300                       0

How can we achieve this year's column difference.Please any one can suggest me.

Regards

Krishna

11 Replies
alexandros17
Partner - Champion III
Partner - Champion III

Example:

Sum({$ <year={2014}> Payment}

-

Sum({$ <year={2013}> Payment}

let me know

avinashelite

Hi Krishna,

Try as mention by Alessandro, if your still not getting please post your app

francoiscave
Partner - Creator III
Partner - Creator III

Hi Krishna,

In your case, if you want a column with the label 2013-2014, you must create it as value in the Year dimension.

It will be better to calculate your values in the script.

Or change the design of your chart.

François

PrashantSangle

Hi,

As per my under standing

If Year and Product are dimension.

and Payment and Recovery are expression then

calculating difference of two value of dimension in Pivot table was not possible.

Try alternate "Straight Table"

and Hardcode Year Field Expression.

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
krishna20
Specialist II
Specialist II
Author

Hi,

All Values getting zeros.The third difference column is not coming separately.It's coming under 2014 and 2013.

Regards

Krishna

krishna20
Specialist II
Specialist II
Author

I followed this post also but no luck.

http://community.qlik.com/message/392636#392636

Regards

Krishna

avinashelite

Hi

Can you please post your app? will check

krishna20
Specialist II
Specialist II
Author

Hi Avinash,

No possibilities to share the app.Connecting the Server through VPN.

Regards

Krishna

krishna20
Specialist II
Specialist II
Author

Hi Alessandro,

I did as per you suggested in pivort table.Getting Extra columns in the result. I added an option partial sums ,then only getting correct result.I dont want the extra fields.How can i remove these fields.Please suggest me how can we achieve it.Please find the attached image,Red color represents unwanted fields ,Green Color represents wanted fields.

Regards

Krishna