Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Rsaiq
Creator
Creator

Summing up values by ID's

Hi All,

I have 3 scriptID in my dataset as 1,2 and 3.

I am doing sum row by row per scriptID using range sum.You can see below in my table there are ScriptID's with their values.I need sum total as per ScriptID's(please refer screenshot below).

Rsaiq_0-1626531679018.png

But i am getting all amount suming up without looking scriptID.

Can anyone have idea how to do sum like this through scripts.

 

Used below scripts in my application:-

Test:
load *,
RangeSum(Peek('NewValue'),Value) as NewValue;

LOAD
ScriptID,
Value,
"Date"
FROM [lib://AttachedFiles/SampleData.xlsx]
(ooxml, embedded labels, table is Sheet2);

Please find attached sample data file.

Thanks 

Labels (2)
1 Solution

Accepted Solutions
Rsaiq
Creator
Creator
Author

Achived what i wanted with previous function
if(previous(ScriptID) = ScriptID, rangesum(peek('NewValue'), Value),Value) as NewValue

Rsaiq_0-1626542510326.png

 

 

Thanks

View solution in original post

1 Reply
Rsaiq
Creator
Creator
Author

Achived what i wanted with previous function
if(previous(ScriptID) = ScriptID, rangesum(peek('NewValue'), Value),Value) as NewValue

Rsaiq_0-1626542510326.png

 

 

Thanks