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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
qlikwiz123
Creator III
Creator III

Fill Missing Values

Table A:

NameIDNo
A19
B  
C577
D  
E  

 

Table B: 

NameIDNo
B411
D623
E947
G456
H6722
N385

 

How do I Join Table B with A so that I can fill all the missing ID and No values in Table A from Table B?

Mapping and Preceeding loads are failing as my tables coming from SQL queries.

Result:

NameIDNo
A19
B411
C577
D623
E947
7 Replies
QFabian
MVP
MVP

Hi @qlikwiz123 , please check if something like this is a solution for your question :

Load

Name,
ID,
No

from B ;

 

concatenate  //optional

Name,
ID,
No

from A

Where

not exists (Name, Name);

 

Greetings!! Fabián Quezada (QFabian)
did it work for you? give like and mark the solution as accepted.
qlikwiz123
Creator III
Creator III
Author

Hi @QFabian 

Thank you. But doing so will bring all the rows from Table B which is not needed. I only need to fill the gaps in Table A with the data present in Table B.

QFabian
MVP
MVP

Perfect, try this then :

 

Map_ID:
mapping
Load
Name,
ID
from B;

Map_No:
mapping
Load
Name,
No
from B;

A:
Load
Name,
if(isnull(ID), ApplyMap('Map_ID', Name), ID) as ID,
if(isnull(No), ApplyMap('Map_No', Name), No) as No
from A;

 

Greetings!! Fabián Quezada (QFabian)
did it work for you? give like and mark the solution as accepted.
qlikwiz123
Creator III
Creator III
Author

Hi,

It should work but does not in my case 😞

Here is my script.

I am joining all these tables to the Main Table and hence you will see Left Join in my Script.

 

Map_ID:

Mapping

Load Name, [Full ID];

SQL SELECT

FullNhm as Name,
FID as "Full ID"

FROM

"ID_Table;


Map_No:

Mapping LOAD

Name, [Full Number];

SQL SELECT

FullNhm as Name
FNO as "Full Number";

FROM

"No_Table;

Left Join(Main_Table)

Load
Name,
if(isnull([Full ID]), ApplyMap('Map_ID', [Full Name]), [Full ID]) as [Full ID],
if(isnull([Full No]), ApplyMap('Map_No', [Full Name]), [Full No]) as [Full No];

SQL SELECT *FROM "Org_Table";

 

I see empty values as original but not the applymap values filling the gaps. Is something wrong in my script and how SQL  Combination is being used?

Arindam_Ghoshal_13
Contributor III
Contributor III

Try this exactly what i have done below & Please mark my answer as Correct if issue get resolved

ArindamLovesQlikSense_1-1613542761689.png

************************************************************************
Tab1:
LOAD
Name,
ID ,
"No"
FROM [lib://Data/Fill Missing Values.xlsx]
(ooxml, embedded labels, table is [Tab A]);

Tab2:
LOAD
Name,
ID ,
"No"
FROM [lib://Data/Fill Missing Values.xlsx]
(ooxml, embedded labels, table is [Tab B])
where exists(Name) ;

NoConcatenate
FinTab:

Load Name,
ID,
No
Resident Tab1
where Len(Trim(ID));

Drop Table Tab1;

Hope it helps 

QFabian
MVP
MVP

Maybe isnt nulls, so :

if(isnull([Full ID]) or [Full ID] =''

And please don't do this, se ate generating the table, no need to join :

Left Join(Main_Table)

Greetings!! Fabián Quezada (QFabian)
did it work for you? give like and mark the solution as accepted.
Saravanan_Desingh

ApplyMap is the good choice here.