Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
aveeeeeee7en
Specialist III
Specialist III

Logic

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

14 Replies
jerem1234
Specialist II
Specialist II

You'll want to use:

rangesum(MOB, peek('NewField')) as NewField

in your script, but need to make sure your sorting is correct.

Find attached for example.

Hope this helps!

NareshGuntur
Partner - Specialist
Partner - Specialist

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

its_anandrjs

Use Range sum in the front end and also you can do this in the load script like

LOAD

    Joining,

     Leaving,

     MOB,

     Month,

     Year,

     RowNo() as ID,

     RangeSum(MOB, Peek('CumalativeSum')) AS CumalativeSum

FROM

Book2.xlsx

(ooxml, embedded labels, table is Sheet1);

aveeeeeee7en
Specialist III
Specialist III
Author

Thank You Guys,

So many Answers in little time and that too of so much varieties. Loved Qlikview Community &its Awesome Developers. All answers are Perfect in their own ways.

Once Again, Thanks for the Answers and your time.

Regards

Aviral

aveeeeeee7en
Specialist III
Specialist III
Author

Hey Massimo, Your answer was awesome.   Loved it.