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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
alexandermllr
Creator
Creator

Qlikview - peek problems

Hello,

I'm trying to fill up the null values with peek:

KeyTimestamp

New_Field

12345

01.01.2018 05:45

Test
1234501.01.2018 10:00
1234501.01.2018 12:00
1234501.01.2018 13:01Test 2
1234501.01.2018 15:15
1234501.01.2018 20:33

I need this table:

KeyTimestamp

New_Field

12345

01.01.2018 05:45

Test
1234501.01.2018 10:00Test
1234501.01.2018 12:00Test
1234501.01.2018 13:01Test 2
1234501.01.2018 15:15Test  2
1234501.01.2018 20:33Test  2

That is my script:

load

Key,

Timestamp,

if(len(trim(New_Field)) = '0' and peek(Key) = Key, peek(New_Field),New_Field) as New_Field

resident Table

order by Key, Timestamp;



The table I get is:

KeyTimestamp

New_Field

12345

01.01.2018 05:45

Test
1234501.01.2018 10:00Test
1234501.01.2018 12:00
1234501.01.2018 13:01Test 2
1234501.01.2018 15:15Test  2
1234501.01.2018 20:33

It's not working for all fields.

Can someone please help me?

Labels (1)
1 Solution

Accepted Solutions
sunny_talwar
MVP
MVP

Try this

LOAD Key,

    Timestamp,

     New_Field,

    If(Len(Trim(New_Field)) = '0' and Peek(Key) = Key, Peek('New_Field1'), New_Field) as New_Field1

Resident Table

Order By Key, Timestamp;


DROP Table Table;

DROP Field New_Field;

RENAME Field New_Field1 to New_Field;

View solution in original post

2 Replies
sunny_talwar
MVP
MVP

Try this

LOAD Key,

    Timestamp,

     New_Field,

    If(Len(Trim(New_Field)) = '0' and Peek(Key) = Key, Peek('New_Field1'), New_Field) as New_Field1

Resident Table

Order By Key, Timestamp;


DROP Table Table;

DROP Field New_Field;

RENAME Field New_Field1 to New_Field;

alexandermllr
Creator
Creator
Author

That works perfect!

Thank you very much!