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

Qlikview to fill in missing values for a dimension

Hi Guys,

Is there any way to tell Qlikview to fill in a missing value from a dimension? Below is an example:

Year# of People Hired
20103
20122
20101
20145
20131
20124

What if I want Qlikview to display a value of zero for the year 2011, how do I do that? Ultimately, I would want to have the following summary table:

Year# of People Hired
20104
20110
20126
20131
20145

Is there any way to fill in the value for 2011?

Thanks in advance.

Joel

1 Solution

Accepted Solutions
sushil353
Master II
Master II

try this:

temp:
LOAD * Inline
[
Year,Hired
2010, 3
2012, 2
2010, 1
2014, 5
2013, 1
2012, 4
]
;


Right join (temp)
LOAD minyear + IterNo()-1 as Year
While (minyear + IterNo()-1) <= Num(maxyear);

LOAD Min(Year) as minyear,
Max(Year) as maxyear
Resident temp;


temp2:
LOAD Alt(Year,0) as y,sum(Hired) as h2
Resident temp
Group by Year;

HTH

Sushil

View solution in original post

4 Replies
qlikmsg4u
Specialist
Specialist

Hi Joel,

If you derived Year from any Date (ex:Hire_Date) better to populate missing dates using master calendar script

sushil353
Master II
Master II

try this:

temp:
LOAD * Inline
[
Year,Hired
2010, 3
2012, 2
2010, 1
2014, 5
2013, 1
2012, 4
]
;


Right join (temp)
LOAD minyear + IterNo()-1 as Year
While (minyear + IterNo()-1) <= Num(maxyear);

LOAD Min(Year) as minyear,
Max(Year) as maxyear
Resident temp;


temp2:
LOAD Alt(Year,0) as y,sum(Hired) as h2
Resident temp
Group by Year;

HTH

Sushil

Not applicable
Author

This is exactly what I wanted to do. Thanks for your time!

Not applicable
Author

Hi,

Please find the attached QVW