Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

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!

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Try :

=RangeSum(VALUE1,VALUE2,VALUE3)

View solution in original post

7 Replies
tresesco
MVP
MVP

Try :

=RangeSum(VALUE1,VALUE2,VALUE3)

Anonymous
Not applicable
Author

what about this?

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

reddy-s
Master II
Master II

Hi Chan,

Use the RangeSum function to achive this as tresesco mentioned.

its_anandrjs

Try this way

In Expression

=Sum(VALUE1 + VALUE2 + VALUE3)

Or

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

Regards,

Anand

brunobertels
Master
Master

Hi

Try like that

data:

load * inline

    [NAME,VALUE1,VALUE2,VALUE3

    John,1,5,8 

    Steve,2,6,3];

   

  

    Data2:

    load

     NAME,

    VALUE1,

    VALUE2,

    VALUE3,

    VALUE1+VALUE2+VALUE3 as SumValue

  

    resident data;

    drop table data

you will get this :

Bruno

Not applicable
Author

Hi all.

Thanks for your answers, by now, doesn't work (rangesum or sum)

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?

Not applicable
Author

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!