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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
yadav_anil782
Creator II
Creator II

Pivot Table calculation

Hi Qlik Expets,

i have  calculated column in pivot table and now i need one more  column that will come against ( debit -credit )

suppose i have two column

Sale of Assets(Credit)Sale of Assets(Debit)

then i need one column more, name will be Sale of Assets (Net)

logic will be      Sale of Assets(Debit) - Sale of Assets(Credit)

i have attached same pivot table in excel  plz find and try to solve my problem

Sale of Assets(Credit)- calculation is   =Sum({<ACCOUNT_CODE = {"4332"}>}PERIOD_CR) and Label  name is Sale of Assets(Credit)


Sale of Assets(Debit)-  calculation is  =Sum({<ACCOUNT_CODE = {"4332"}>}PERIOD_DR)  and Label name is Sale of Assets(Debit)



Sale of Assets(Net) =??


5 Replies
sujeetsingh
Master III
Master III

You can use Column 1- column2

jonathandienst
Partner - Champion III
Partner - Champion III

You can either reuse the expressions:

=Sum({<ACCOUNT_CODE = {"4332"}>} PERIOD_DR) - Sum({<ACCOUNT_CODE = {"4332"}>} PERIOD_CR)

or you can reference the columns in the same table by name, or using the Column(n) function:

=[Sale of Assets(Debit)] - [Sale of Assets(Credit)]

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
SreeniJD
Specialist
Specialist

As Sujeet mentioned,

Use these calculated columns in your expression and do a substraction from Debt to Credit.. Also handle null values and force them to "zero". this will works

Sreeni

jonathandienst
Partner - Champion III
Partner - Champion III

t1.png

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Anonymous
Not applicable

you can use if want to handle null values

if(isnull(ColumnNo(1)),0-ColumnNo(2),if(isnull(columnNo(2),ColumnNo(1)))