Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
alexandermllr
New Contributor II

Qlikview Fill up data

Hello,

I have this data format:

Key

Timestamp

Name

1234501.02.2017 05:00Alex
1234501.02.2017 05:30
12345

02.02.2017 03:46

12345

02.02.2017 17:02

Alex
54321

07.02.2017 18:23

Peter
98765

13.02.2017 20:45

Alex

I want to fill up the Name between the timestamp.

order by the key and timestamp.

I hope someone can help me


Thanks!

1 Solution

Accepted Solutions
mwoolf
Honored Contributor II

Re: Qlikview Fill up data

Data:

load

     Key,

     Timestamp,

     if(Key = peek('Key') and isnull(Name),peek('Name'),Name) as Name

from yourDB

order by Key, Timestamp;

8 Replies
mwoolf
Honored Contributor II

Re: Qlikview Fill up data

Data:

load

     Key,

     Timestamp,

     if(Key = peek('Key') and isnull(Name),peek('Name'),Name) as Name

from yourDB

order by Key, Timestamp;

ahaahaaha
Honored Contributor

Re: Qlikview Fill up data

Hi Alexander,

If I understand you correctly, maybe something like this?

Table1:

LOAD Key,

     If(Key=Previous(Key), 1, 2) as ID_Key,

     Timestamp,

     Name

FROM

Book1.xlsx

(ooxml, embedded labels, table is Sheet1, filters(

Replace(1, top, StrCnd(null)),

Replace(3, top, StrCnd(null))

));

NoConcatenate

TableFinish:

LOAD

If(IterNo()=ID_Key, Key) as Key,

If(IterNo()=ID_Key, Timestamp(Timestamp), Name) as Timestamp

Resident Table1

While IterNo()<=ID_Key;

DROP Table Table1;

Result

1.jpg

Format Timestamp determine what you need.

Regards,

Andrey

alexandermllr
New Contributor II

Re: Qlikview Fill up data

Hello,

i want to have this:

Key

Timestamp

Name

1234501.02.2017 05:00Alex
1234501.02.2017 05:30Alex
12345

02.02.2017 03:46

Alex
12345

02.02.2017 17:02

Alex
54321

07.02.2017 18:23

Peter
98765

13.02.2017 20:45

Alex

If there is in same 'Key' two lines with the same "Name" and empty 'Name' between the 'Timestamp', it should fill up the "Name".

Thank you

sdmech81
Valued Contributor

Re: Qlikview Fill up data

HI,

PFA fr the same..

Check the script aswell   ..Data also attached in excel sheet 2

Sachin

sdmech81
Valued Contributor

Re: Qlikview Fill up data

Find excel as well..Sorry I think I missed excel attachment..

Sachin

khalander
Contributor II

Re: Qlikview Fill up data

Hi,

load

Key,

Timestamp,

if(isnull(Name),Peek(Name),Name) as Name

resident main_table

order by Key,Timestamp;

Hope it will work

alexandermllr
New Contributor II

Re: Qlikview Fill up data

Thank you

I had to use len(Name) = 0

surendraj
Valued Contributor

Re: Qlikview Fill up data

Its better to use

if(len(Trim(Name)) = 0)

Make sure to use trim to avoid necessary spaces..

Community Browser