Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

alexandermllr
Contributor

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?

Tags (3)
1 Solution

Accepted Solutions

Re: Qlikview - peek problems

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;

2 Replies

Re: Qlikview - peek problems

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;

Highlighted
alexandermllr
Contributor

Re: Qlikview - peek problems

That works perfect!

Thank you very much!