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

Announcements
Now accepting applications for the Qlik Luminary and Partner Ambassador Programs: Apply by July 6!
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.

Labels (1)
1 Solution

Accepted Solutions
Kushal_Chawda
MVP
MVP

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
MVP
MVP

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
MVP
MVP

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;