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: 
pauljohansson
Creator III
Creator III

Propagate values downwards

Hi all happy Qlikview people,

I have a seemingly easy problem that i don't manage to solve.I want to populate the LastActiveWeek column downwards. I have been looking at Peek(). But since its impossible prehand to know how many rows I need to go back and check I cant get it to work.


Starting Point:

RegistrationDate

Customer WeekDate LastActiveWeek
2015-01-01794955011
2015-01-0179495502
2015-01-01794955033
2015-01-0179495504
2015-01-01794955055
2015-01-0179495506
2015-01-0179495507
2015-01-017949550

8

2015-01-0179495509
2015-01-01794955010

Goal:

RegistrationDate

CustomerWeekDateLastActiveWeek
2015-01-01794955011
2015-01-01794955021
2015-01-01794955033
2015-01-01794955043
2015-01-01794955055
2015-01-01794955065
2015-01-01794955075
2015-01-017949550

8

5
2015-01-01794955095
2015-01-017949550105

What would the recommended technique be? Any guidance or ideas are very much appreciated.

Thanks in advance,

Br

Paul

Message was edited by: Paul Johansson

1 Solution

Accepted Solutions
sunny_talwar

Hey Paul,

This is the output from your data

So, Peek is going to fill in all the cells which are empty with the last given value above it.

HTH

Best,

S

View solution in original post

8 Replies
Anonymous
Not applicable

Se attached, the script is quite simple.

sunny_talwar

Table:

LOAD RegistrationDate,

     Customer,

     WeekDate,

     LastActiveWeek

FROM

[http://community.qlik.com/thread/151302]

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

Table1:

NoConcatenate

LOAD RegistrationDate,

     Customer,

     WeekDate,

     If(Len(Trim(LastActiveWeek)) = 0, Peek('LastActiveWeek'), LastActiveWeek) as LastActiveWeek

Resident Table;

DROP Table Table;

Hope this helps

Best,

S

pauljohansson
Creator III
Creator III
Author

Hi Michael,

Thanks for your reply.


If you check my table, you see that there sometimes might be several rows without any value:

2015-01-01794955055
2015-01-0179495506
2015-01-0179495507
2015-01-017949550

8

2015-01-0179495509
2015-01-01794955010

A Peek would result in:

2015-01-01794955055
2015-01-01794955065
2015-01-0179495507
2015-01-017949550

8

2015-01-0179495509
2015-01-01794955010

leaving most of the rows empty,

br

Paul

pauljohansson
Creator III
Creator III
Author

Hi Sunindia,

Thanks for your reply.

If you check my starting point table you see that there sometimes are several rows that are empty. So Peek the previous row will not solve the problem.


br

Paul

sunny_talwar

Hey Paul,

This is the output from your data

So, Peek is going to fill in all the cells which are empty with the last given value above it.

HTH

Best,

S

Anonymous
Not applicable

So is in my example.  You've missed something in your script, I assume.

delmak2000
Creator
Creator

Hello, Sunny.....Can't seem to find the solution u provided to Paul....Pls help....

My case is a little bit similar.....

I want to propagate the last value if though the date for that data doesn't exist.

Thanks

sunny_talwar

Do you have a sample you can share?