Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone,
I'm trying to sum two column totals. What I need is a new column,where I will show sum of two previous columns.
Example:
Col1: Apples=5
Col2: Grapes=10
I want a new column as Fruits=15
Similar way I want the difference of those two columns
Thank You
load col1+col2 as fruits, col1, col2;
load
....
.....
;
Can you paste the table for some values?
Sum=Count(Col1)+Count(Col2)
Diff=Count(Col1)-Count(Col2) or viceversa
RangeSum(Col1, Col2) as Fruits
Or, simply
Col1+Col2 as Fruit // this won't work if there are null values
Alt(Col1,0)-Alt(Col2,0) as Difference
Or, simply
Col1-Col2 as Difference // this won't work if there are null values
Do you need to represent this in UI or you want this for script
For UI you can easily do this by Pivot table
Hi,
In chart you have do do like
Assume Column One is
Col1: Apples=5
And Column two is
Col2: Grapes=10
Column(1) + Column(2)
And you need this in the expression or load script.
If load script then
LOAD Apples,Grapes,Apples+Grapes as Sum;
LOAD * Inline
[
Apples,Grapes
5,10
];
Regards
Anand