Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Folks,
i got a simple data.
MaterialNr, Share,
A , 5.25
B, 3.26
C, 4.34
i am trying to create a simple cumulative value, i used 2 Options:
1. rangesum(Share, Peek('Cumul')) as Cumul
2. if(MaterialNr= Previous(MaterialNr),Share+ Peek('Cumul'),Share) as Cumul
but both expressions do not work.
my output is:
MaterialNr, Share, Cumul
A , 5.25 , 5.25
B, 3.26, 8.51
C, 4.34, 12.85
does anybody have any idea how to solve this issue?
Thanks a lot
I'm afraid I have no idea what you're showing me. If you use this with the inline data (which is the data you provided), it works:
Load MaterialNr, Share, if(RecNo()=1,Share,Peek(Cumul)+Share) as Cumul INLINE [
MaterialNr, Share
A , 5.25
B, 3.26
C, 4.34
];
There's a number of ways to achieve this, but I've picked the one I find easiest to read:
Load MaterialNr, Share, if(RecNo()=1,Share,Peek(Cumul)+Share) as Cumul INLINE [
MaterialNr, Share
A , 5.25
B, 3.26
C, 4.34
];
Thanks a lot for your feedback, but this expression does not work as well
as suggested by @Or , you can try it in data load editor
or
In report , you can use the below highlighted expression,
RangeSum(Above(sum(Share),0,RowNo()))
@Lakshminarayanan_J thanks a lot for your feedback. i can solve this issue as expression, but i need this calculation in script .
Thanks a lot
This expression works - I confirmed it by running it locally before posting. If it does not achieve what you were trying to achieve, and you want further assistance, you'll have to be more specific than "Does not work".
I'm afraid I have no idea what you're showing me. If you use this with the inline data (which is the data you provided), it works:
Load MaterialNr, Share, if(RecNo()=1,Share,Peek(Cumul)+Share) as Cumul INLINE [
MaterialNr, Share
A , 5.25
B, 3.26
C, 4.34
];
@Or AND @Lakshminarayanan_J thanks a lot for your time and your help