Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
upaliwije
Creator II
Creator II

sum

I have a pivot table with following dimension and mesures

Dept                     Debit_Amount   Settled_Amount Cancelled_Amount     Balance

01341621,620166,64500
02718822,16985,53032,4040
03588536,3765,55000

I have written the following expression to obtain balance But It is not giving desired result. Instead show 0 values

SUM( Debit_Amount -Settled_Amount -Cancelled_Amount)

Pls help me to correct the expression

7 Replies
its_anandrjs

I believe you use the column names if so then remove the SUM from the expression.


(Debit_Amount -Settled_Amount -Cancelled_Amount)

upaliwije
Creator II
Creator II
Author

Thanks

Still the Balance value is zero

its_anandrjs

Please elaborate more

what is mean for Debit_Amount,  Settled_Amount, Cancelled_Amount this are fields or column name in the chart.

upaliwije
Creator II
Creator II
Author

load DEBIT_NOTE_NO,SETTLEMENT_DATE,SETTLED_AMOUNT AS SETTLED_AMOUNT;

sql

select Max(Ref_date)SETTLEMENT_DATE

,det_ref_C DEBIT_NOTE_NO ,

sum(NVL(det_hc_amt,0)) SETTLED_AMOUNT

from T_debtor

group by ref_C;

These are really fields as given above SETTLED_AMOUNT

Not applicable

Try with before function, otherwise share your sample.QVW

Regards,

Chinni

upaliwije
Creator II
Creator II
Author

It is not working

upaliwije
Creator II
Creator II
Author

Hi

I got the correct answer. The Expression should be as follows

sum(DEBIT_AMOUNT)-sum(SETTLED_AMOUNT)-SUM(CANCELLED_AMOUNT)

Thanks all