Qlik Community

QlikView Management

Discussion Board for collaboration on QlikView Management.

Not applicable

FILLING NULL VALUES

Hi

I have an issue with filling null values in the table.

Please find attached sample document with a QVD  file for information. As you can see there are some null values against date and divisions.

I want to put the previous value (for null value fields)against the division until the next available value in the table. The reason is I need to record a value every single day from the start date to finish date for every single location. If there is no values against a division, I want to pick up the previous value against the division

Hope you will understand what I try to achieve.

Can you please advice.

Regards

Harsh

1 Solution

Accepted Solutions
MVP
MVP

Re: FILLING NULL VALUES

Maybe like this:

T1:

LOAD [Division Code],

    JOB_TRANS_DATE,

    JOB_NET_VALUE

FROM

[Fuel_Transaction.qvd]

(qvd);

T2:

NOCONCATENATE

LOAD  [Division Code],

  JOB_TRANS_DATE,

  If(len(trim(JOB_NET_VALUE)),JOB_NET_VALUE, if(Peek([Division Code])=[Division Code],Peek(JOB_NET_VALUE))) as JOB_NET_VALUE

RESIDENT T1 

ORDER BY

[Division Code], JOB_TRANS_DATE;

DROP TABLE T1;

2 Replies
MVP
MVP

Re: FILLING NULL VALUES

Maybe like this:

T1:

LOAD [Division Code],

    JOB_TRANS_DATE,

    JOB_NET_VALUE

FROM

[Fuel_Transaction.qvd]

(qvd);

T2:

NOCONCATENATE

LOAD  [Division Code],

  JOB_TRANS_DATE,

  If(len(trim(JOB_NET_VALUE)),JOB_NET_VALUE, if(Peek([Division Code])=[Division Code],Peek(JOB_NET_VALUE))) as JOB_NET_VALUE

RESIDENT T1 

ORDER BY

[Division Code], JOB_TRANS_DATE;

DROP TABLE T1;

Not applicable

Re: FILLING NULL VALUES

Thanks a lot. It works.

Community Browser