Discussion Board for collaboration related to QlikView App Development.
load * Inline
Test_A, Test_B, Test_C
10.001, 20, 1
31, 1, 2
QUALIFY * ;
load sum(Test_A) - sum(Test_B) as TOTAL
group by Test_C;
load sum(Test_A - Test_B) as TOTAL
Is there a difference in this two differents ways to calculate sum ?
(In my example this is exactly the same, but in my application with huges datas there are difference and I think is due to this calculation)
In some cases they can give different results.
Suppose that for some records the Test_B is null(). Then the second expression will skip the whole record even if the Test_A is not null, because Test_A - null() = null()
View solution in original post
maybe if you have some null in your application data
load rowno() as id, Test_A, if(Test_B='-',null(),Test_B) as Test_B, Test_C;
100, 10, 1
100, 1, 2
load Test_C, sum(Test_A) - sum(Test_B) as TOTAL
load Test_C, sum(Test_A - Test_B) as TOTAL
first expression is f sum of differnce
where as second is difference of sum