Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikWorld happening right now! You can still join: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
yanivvl0
Creator III
Creator III

Why set analaysis sum ( minus ) gives different result when seperate?

hi to all qv helpers ,

can anyone tell me why the result of the 2 expressions is not the same :

sum (    {$<Subject={1},[s_code]={3},[z_code]={1}>}   val_a - val_b   )  

sum (    {$<Subject={1},[s_code]={3},[z_code]={1}>}   val_a     ) –

sum (    {$<Subject={1},[s_code]={3},[z_code]={1}>}     val_b     )  


thanks !

1 Solution

Accepted Solutions
marcus_sommer
MVP & Luminary
MVP & Luminary

Your first expression will be evaluated on record-level and if for example val_a or val_b isn't numeric or NULL the result for this record will be NULL. Your second expression will subtract the aggregation from two columns. And therefore you could get different results.

- Marcus

View solution in original post

3 Replies
sunny_talwar

Not really sure why it would do that, do you have a sample to show the issue?

marcus_sommer
MVP & Luminary
MVP & Luminary

Your first expression will be evaluated on record-level and if for example val_a or val_b isn't numeric or NULL the result for this record will be NULL. Your second expression will subtract the aggregation from two columns. And therefore you could get different results.

- Marcus

yanivvl0
Creator III
Creator III
Author

thanks Marcus - yea this is it.