Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Fill Missing Entries

I have the following kind of data which I would like to modify after it is loaded to the qlikview:

CompanyYearEmployees
A2011100
A2012120
A201380
B201290
B2013110
C2013130

Since B and C don't have values corresponding to years 2011 and 2012, is it possible to write 0 instead of missing entries? At the end it should look like this:

CompanyYearEmployees
A2011100
A2012120
A201380
B20110
B201290
B2013110
C20110
C20120
C2013130

Please help me in writing script for this conversion.

1 Solution

Accepted Solutions
alexandros17
Partner - Champion III
Partner - Champion III

 

TAB:

LOAD * Inline [
Company, Year, Employees
A, 2011, 100
A, 2012, 120
A, 2013, 80
B, 2012, 90
B, 2013, 110
C, 2013, 130
]
;

TEMP:
NoConcatenate
LOAD Distinct Year Resident TAB;
Join
LOAD Distinct Company Resident TAB;
Left Join
LOAD Company, Year, Employees as empl Resident TAB;
DROP Table TAB;

FINAL:
NoConcatenate
LOAD Company, Year, If(isnull(empl), 0, empl) as Employees Resident TEMP;
DROP Table TEMP;

let meknow

View solution in original post

3 Replies
alexandros17
Partner - Champion III
Partner - Champion III

 

TAB:

LOAD * Inline [
Company, Year, Employees
A, 2011, 100
A, 2012, 120
A, 2013, 80
B, 2012, 90
B, 2013, 110
C, 2013, 130
]
;

TEMP:
NoConcatenate
LOAD Distinct Year Resident TAB;
Join
LOAD Distinct Company Resident TAB;
Left Join
LOAD Company, Year, Employees as empl Resident TAB;
DROP Table TAB;

FINAL:
NoConcatenate
LOAD Company, Year, If(isnull(empl), 0, empl) as Employees Resident TEMP;
DROP Table TEMP;

let meknow

Not applicable
Author

my doubt is

can we write directly like

if(isnull(employee),0,employee)     ?

Not applicable
Author

It works..!!

Thanks