7 Replies Latest reply: Dec 14, 2015 7:28 AM by chan go

# sum row values in qlik sense

Hi all.

I have a csv file like this:

```NAME     VALUE1        VALUE2      VALUE3

John        1          5           8
Steve       2          6           3
```

I want to present the same data in a table plus a column with the sum of the VALUE{1,2,3} like this:

```NAME     VALUE1        VALUE2      VALUE3       VALUESTOTAL

John        1          5           8            14
Steve       2          6           3            11
```

I tried with SUM and the showing total is 0.

Somebody can please tell me a light?

Thanks!

• ###### Re: sum row values in qlik sense

Try :

=RangeSum(VALUE1,VALUE2,VALUE3)

• ###### Re: sum row values in qlik sense

=sum(Value1)+sum(Value2)+sum(Value3) as ValuesTotal

• ###### Re: sum row values in qlik sense

Hi Chan,

Use the RangeSum function to achive this as tresesco mentioned.

• ###### Re: sum row values in qlik sense

Try this way

In Expression

=Sum(VALUE1 + VALUE2 + VALUE3)

Or

=Sum(VALUE1) + Sum(VALUE2) + Sum(VALUE3)

Regards,

Anand

• ###### Re: sum row values in qlik sense

Hi

Try like that

data:

[NAME,VALUE1,VALUE2,VALUE3

John,1,5,8

Steve,2,6,3];

Data2:

NAME,

VALUE1,

VALUE2,

VALUE3,

VALUE1+VALUE2+VALUE3 as SumValue

resident data;

drop table data

you will get this :

Bruno

• ###### Re: sum row values in qlik sense

Hi all.

I forgot mention that my VALUE columns are product of a subfield statement in the load script:

```    subfield([BIG ACTIVITIES], ' ', 1) as TYPEOFACT,
subfield([[BIG ACTIVITIES], ' ', 2) as VALUE1,
subfield([[BIG ACTIVITIES], ' ', 3) as VALUE2,
subfield([[BIG ACTIVITIES], ' ', 4) as VALUE3,

```

Any clue?

• ###### Re: sum row values in qlik sense

Solved with rangesum.

My issue: VALUE{1,2,3} has strings and must be operated BEFORE of sum, in my case, with COUNT.

Thanks a lot for the help!