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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Accumulation in script help

how to get count of rows in load script

Date                ID

24/04/2017       11

25/04/2017       10

26/04/2017       12

27/04/2017       37

want to know count of rows if select 26/04/2017 - count should be  3, if 27/04/2017 --- count should be 4



12 Replies
sunny_talwar

I want 1 step back accumulation in the script as a new field

Can you explain this with an example? I am not sure I understand this

Anonymous
Not applicable
Author

In the above case, if I select 24th Date Sum of ID should be 11,

                           if I select 25th Date Sum of ID should be 10 + 11  -->21

                            if I select 26th Date Sum of ID should be  12 +10 - > 22

sunny_talwar

Try this

A:

LOAD * INLINE [

    Date, ID

    24/04/2017, 11

    25/04/2017, 10

    26/04/2017, 12

    27/04/2017, 37

];

B:

Load Date,

  ID,

  RowNo() as Count1,

  RangeSum(Peek('CumID'), ID) as CumID

Resident A

Order By Date asc;

Drop table A;