Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
sivakrishna
Contributor II
Contributor II

Deriving New field through Script editor

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   

 

 

 

1 Solution

Accepted Solutions
YoussefBelloum
Champion
Champion

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;

View solution in original post

1 Reply
YoussefBelloum
Champion
Champion

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;