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

Calculations not in all rows

Hello guys,

When I try to make arithmetic operations with values in rows result is calculated only in rows where exist every part of expression. Here is example

sample:

load * inline [

ID, T1, T2

1, 1, 1

2, , 1

3, 1, 1

4, 1,

]

;

Left Join (sample)

LOAD

  ID,

  T1+T2 as SUM

Resident sample

;

Result is

2014-05-06 16.31.22.png

How can calculate sum for every row? So, for ID 2 and 4 it should be 1

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Instead of

.....

  T1+T2 as SUM

try like:

RangeSum(T1, T2) as SUM

View solution in original post

3 Replies
tresesco
MVP
MVP

Instead of

.....

  T1+T2 as SUM

try like:

RangeSum(T1, T2) as SUM

jagannalla
Partner - Specialist III
Partner - Specialist III

Try this.

sample:

LOAD ID,If(T1='',0,T1) as T1,If(T2='',0,T2) as T2;

load * inline [

ID, T1, T2

1, 1, 1

2, , 1

3, 1, 1

4, 1,

];

Left Join (sample)

LOAD

  ID,

  T1+T2 as SUM

Resident sample

;

yura_ratu
Partner - Creator II
Partner - Creator II
Author

It works. Thanks