Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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!
Try :
=RangeSum(VALUE1,VALUE2,VALUE3)
what about this?
=sum(Value1)+sum(Value2)+sum(Value3) as ValuesTotal
Hi Chan,
Use the RangeSum function to achive this as tresesco mentioned.
Try this way
In Expression
=Sum(VALUE1 + VALUE2 + VALUE3)
Or
=Sum(VALUE1) + Sum(VALUE2) + Sum(VALUE3)
Regards,
Anand
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
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?
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!