Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All
Need Logic from Script:
MOB Desired Output by using MOB
10 10
20 10+20=30
30 10+20+30=60
40 10+20+30+40=100
50 10+20+30+40+50=150
Regards
Aviral
Hi Nag,
Please use the following script.
Credits to Jagan Mohan.(How can I calculate a cumulative sum in load script?)
TableName:
LOAD
F1,
F2,
RangeSum(F2, Peek('CumSum')) AS CumSum;
LOAD * INLINE [
F1, F2
a, 100
b, 200
c, 300
d, 400
];
Cheers,
Naresh
Can you try in the script
Previous(MOB)/2 AS [New Field Requirement]
looks like this in my example
Use Previous function.
Hi Alan, I actually want this:
MOB Desired Output by using MOB
10 10
20 10+20=30
30 10+20+30=60
40 10+20+30+40=100
50 10+20+30+40+50=150
Yes I see, I am trying to figure it out
Provide your previous image also where you explain it will more clear.
Use this expression
RangeSum(above(sum(MOB),0,RowNo()))
you can also use
to get the running Average
hope that helps
Thanks Alan, it is working Perfectly.
But I have used it earlier. As I said in my requirement, I need this thing from the Script not from my Chart Expression.
a:
load
MOB,
alt(peek(MOBSUM),0) +MOB as MOBSUM;
load * inline [
MOB
10
20
30
40
50
];
EDIT
or this?
a:
load
MOB,
alt(peek(MOBSUM),0) +MOB as MOBSUM,
if(rowno()=1, text(MOB), peek(MOBSUMTXT) & ' + ' & text(MOB)) as MOBSUMTXT;
load * inline [
MOB
10
20
30
40
50
];