Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to acumulate a column by LOAD Script?

Hi Folks,

I have a little problem with LOAD Script.

I have a Excel sheet like this:

DateHourPeriod in Use
01-02-201210:39:460:01:00
01-02-201210:56:220:01:00
01-02-201211:09:250:05:30
01-02-201211:13:580:01:00
01-02-201211:46:000:01:30
01-02-201211:49:240:01:30
01-02-201212:12:290:04:00
01-02-201213:17:020:05:00
01-02-201213:32:080:01:00
01-02-201214:17:510:10:00
01-02-201215:37:340:04:00
01-02-201216:03:360:00:00
01-02-201216:08:590:02:30
01-02-201216:56:140:02:00

And I would like to acumulate the column "Period in Use", but I can´t do it in script!!

I'd tried using the function above in Load Script, but it is not run correctly what I want.

I would like transform that datas in a new table like this:

DateHourPeriod in UseAcumulated OK
01-02-201210:39:460:01:000:01:00
01-02-201210:56:220:01:000:02:00
01-02-201211:09:250:05:300:07:30
01-02-201211:13:580:01:000:08:30
01-02-201211:46:000:01:300:10:00
01-02-201211:49:240:01:300:11:30
01-02-201212:12:290:04:000:15:30
01-02-201213:17:020:05:000:20:30
01-02-201213:32:080:01:000:21:30
01-02-201214:17:510:10:000:31:30
01-02-201215:37:340:04:000:35:30
01-02-201216:03:360:00:000:35:30
01-02-201216:08:590:02:300:38:00
01-02-201216:56:140:02:000:40:00

Because I need to use the column Acumulate for a Simple Graph Table.

I don´t want to do it on a Graph Bar Table or Graph Pivot...

Have anyone of you a idea?

Thank you so much.

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Rodrigo,

try using the peek() function, not above(), like

Acc:

LOAD Date,

     Hour,

     [Period in Use],

     interval(rangesum(peek(Accumulated),[Period in Use])) as Accumulated

FROM

[http://community.qlik.com/thread/56095?tstart=0]

(html, codepage is 1252, embedded labels, table is @1);

View solution in original post

2 Replies
swuehl
MVP
MVP

Rodrigo,

try using the peek() function, not above(), like

Acc:

LOAD Date,

     Hour,

     [Period in Use],

     interval(rangesum(peek(Accumulated),[Period in Use])) as Accumulated

FROM

[http://community.qlik.com/thread/56095?tstart=0]

(html, codepage is 1252, embedded labels, table is @1);

Not applicable
Author

Perfect, my friend!!

I'd tried with peek() but incorrectly!

Your script runs ok!!

Thank you so much!