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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Fill empty values with last not null values

Hi,

I need to resolve this issue in load script.

For every ID and Task I have WorkFlow Id (min Start Date), but I need the same Workflow Id for all next empty values.

I have tried Previous and Peek function but without success.

Capture.JPG

Any help?

Thanks.

T.

1 Solution

Accepted Solutions
Kushal_Chawda

try this

Data:

LOAD

  ID,

  Task,

  [Start Date],

  [End Date],

  [Workflow Id]

FROM Source;


Final:

noconcatenate

LOAD *,

          if(len(trim([Workflow Id]))=0,peek([Workflow ID]),[Workflow Id]) as [Workflow ID]

Resident Data

order by ID,Task,[Start Date];


drop table Data;


View solution in original post

3 Replies
Anil_Babu_Samineni

Can you share sample instead of image. Or look at here Get previous row value when the value is null

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
jonathandienst
Partner - Champion III
Partner - Champion III

Something like:

LOAD

  ID,

  Task,

  [Start Date],

  [End Date],

  If(Len([Workflow Id]) = 0, Peek([Workflow Id]), [Workflow Id]) as [Workflow Id]

FROM ....

Have not tested this as you pasted your sample data as an image.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Kushal_Chawda

try this

Data:

LOAD

  ID,

  Task,

  [Start Date],

  [End Date],

  [Workflow Id]

FROM Source;


Final:

noconcatenate

LOAD *,

          if(len(trim([Workflow Id]))=0,peek([Workflow ID]),[Workflow Id]) as [Workflow ID]

Resident Data

order by ID,Task,[Start Date];


drop table Data;