Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Fill empty cells with value from "above"

Hello,

my problem is that i have a table like this:

DateValue1Value2
01.01.201320

30

45321
21323
678798
02.01.2013123123
32323232
578953
644217655

That is because of the formatting of the excel sheet is done by merging the date column. However qlikview only gets one value out of it.

Is there a way to fill these empty cells with the same Date as in the first row ??

I tried using "previous" in the load script but it only works for the next row after the first one.. the rest still stays empty..

thank your for your time.

1 Solution

Accepted Solutions
Not applicable
Author

Hi,

You can fill blank values with the import assistant of excel files.

1.png

In Cell Conditions : Choose 'is empty'

2.png

View solution in original post

8 Replies
israrkhan
Specialist II
Specialist II

post your script...or try like below

load

if(Date= ' ' or  isnull (Date), Previous(Date),Date) as Date,

or

if(Date= ' ' or  isnull (Date), Peek(Date),Date) as Date,

MayilVahanan

Hi

Try like this

Load Value1, Value2, If(Len(Trim(Date)) = 0, Peek('Date'), Date) AS Date From tablename;

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

Here's the script...

CrossTable(Entscheid, Anzahl,8)

LOAD if(F2='',Previous(date(F2)),date(F2)) as Datum,

          num(F5) as Schicht,

          Time(F3) as von,

          Time(F4) as bis,

          Month (F2) as Monat,

          Year(F2) as Jahr,

          Bauteil,

          num([Run / Set]) as [Run / Set],

          iO,

          [Spritzer (Pulver / Overspray)],

          Spitting as Spitting,

          [Gewicht ausser Toleranz]

FROM

.... ( ... );

Not applicable
Author

Hi,

You can fill blank values with the import assistant of excel files.

1.png

In Cell Conditions : Choose 'is empty'

2.png

Not applicable
Author

Thank you!!

israrkhan
Specialist II
Specialist II

you are using date function one side in if statement...

so i think comparison goes wrong...

try this one...


CrossTable(Entscheid, Anzahl,8)

LOAD if(date(F2)=' ',Previous(date(F2)),date(F2)) as Datum,

          num(F5) as Schicht,

          Time(F3) as von,

          Time(F4) as bis,

          Month (F2) as Monat,

          Year(F2) as Jahr,

          Bauteil,

          num([Run / Set]) as [Run / Set],

          iO,

          [Spritzer (Pulver / Overspray)],

          Spitting as Spitting,

          [Gewicht ausser Toleranz]

rbecher
MVP
MVP

In script you can just use the peek() function:

LOAD

if(len(trim(Date))=0, peek(Date), Date) as Date,  // len(trim(<field>))=0 is the best way to catch NULL and empty string

Value1,

Value2

FROM...

- Ralf

Astrato.io Head of R&D
Anonymous
Not applicable
Author

Similar answer here      Excel file with merged cells to be imported