Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi I have table with limited columns like
Load * Inline
[sub,marks
A,50
B,60
C,35
D,30
];
i want to derive a new column i.e % of each value from total given marks
example 50/175, 60/175
Hi,
here is one way to do this:
table:
Load * Inline
[sub,marks
A,50
B,60
C,35
D,30
];
sum:
LOAD
sum(marks) as summarks
Resident table;
let vSumMarks=peek('summarks');
DROP Table sum;
table2:
LOAD *,marks/$(vSumMarks) as %
Resident table;
DROP Table table;
Hi,
here is one way to do this:
table:
Load * Inline
[sub,marks
A,50
B,60
C,35
D,30
];
sum:
LOAD
sum(marks) as summarks
Resident table;
let vSumMarks=peek('summarks');
DROP Table sum;
table2:
LOAD *,marks/$(vSumMarks) as %
Resident table;
DROP Table table;