Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

running sum Load data

Hi, all

I'm tracking some information like views clicks from youtube into database. But this number comes with running sum like:

id, dim1, views

1, A, 1000

2, B, 500

3, A, 1500

4, B, 1000

....

Do you any way to when i'm load and store this data on qvd have only the gain value? like:

id, dim1, views

1, A, X

2, B, X

3, A, 500    ...the difference between 1500-1000 (dim1 =A)

4, B, 500    ...the difference between 1000-500 (dim1 =B)

....

I need to store the table like that because on the future analysis i'll need to sum this info by date or by dimension.

swuehl‌ I see a discussion where you explain something like this. Can you help me please?

Thanks,

Pedro Lopes

1 Solution

Accepted Solutions
sunny_talwar

Try this

Table:

LOAD * Inline [

id, dim1, views

1, A, 1000

2, B, 500

3, A, 1500

4, B, 1000

];

FinalTable:

NoConcatenate

LOAD id,

dim1,

If(dim1 = Previous(dim1), views - Previous(views), views) as views

Resident Table

Order By dim1, id;

DROP Table Table;

View solution in original post

2 Replies
sunny_talwar

Try this

Table:

LOAD * Inline [

id, dim1, views

1, A, 1000

2, B, 500

3, A, 1500

4, B, 1000

];

FinalTable:

NoConcatenate

LOAD id,

dim1,

If(dim1 = Previous(dim1), views - Previous(views), views) as views

Resident Table

Order By dim1, id;

DROP Table Table;

Anonymous
Not applicable
Author

Thanks Sunny It's work.