Skip to main content
Announcements
Customer Spotlight: Discover what’s possible with embedded analytics Oct. 16 at 10:00 AM ET: REGISTER NOW
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
Specialist III
Specialist III

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);

 

QFabian
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
Specialist III
Specialist III

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;

 

QFabian
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
Specialist III
Specialist III

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)

QFabian
Saravanan_Desingh

ApplyMap is the good choice here.