Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
upaliwije
Creator II
Creator II

expression

HI FRIENDS

I Have two following expression in my pivot table

sum(CL_AMT-RECOV-FORE)

sum(CL_AMT)-sum(RECOV)-sum(FORE)

Results of the two expression are different. second one gives me the correct result

Any reason for this ? pls let me know

1 Solution

Accepted Solutions
swuehl
MVP
MVP

If values are null,  record in first expression will contribute with Null. Try sum(rangesum(amount,-recov,-forecast))

View solution in original post

5 Replies
swuehl
MVP
MVP

If the three fields are located in different tables in your data model, QV will use a temporary join to calculate first expression.

upaliwije
Creator II
Creator II
Author

ALL DATA ARE IN SAME TABLE

swuehl
MVP
MVP

If values are null,  record in first expression will contribute with Null. Try sum(rangesum(amount,-recov,-forecast))

jagan
Luminary Alumni
Luminary Alumni

Hi,

If all the three fields are in the same table, then both the expressions will match, if those are in different tables then they may or may not match, because of the joining may be some records will miss on the joining or when joined some records values may be null.  This are the possible chances hope this helps you.

Regards,

Jagan.

jagan
Luminary Alumni
Luminary Alumni

Hi,

If all data are in the same table then use Rangesum() like below because some of the values are null then when you do sum the sum will results null.

Rangesum(CL_AMT, -RECOV, -FORE)


OR


Sum(Alt(CL_AMT, 0), -Alt(RECOV, 0), -Alt(FORE, 0))


Regards,

jagan.