Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
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;