Skip to main content
Announcements
See why Qlik was named a Leader in the 2024 Gartner® Magic Quadrant™ for Data Integration Tools for the ninth year in a row: Get the report
cancel
Showing results for 
Search instead for 
Did you mean: 
ksomosera10
Creator II
Creator II

How to Merge two Tables and removing nulls from Association

Hi Everyone,

I'm trying to join two tables with one key field.

However, my problem is it keeps on separating the data into two and adding a null.

I'm expecting that it should be 1 liner approached.

ksomosera10_0-1625635071343.png

On the image, I want to merge the two lines using the matching Keyfield column.

I expect it to be like this:

ksomosera10_1-1625635191007.png

 

I hope you can help me how I handle it on the Load scripting.

Thank you!

5 Replies
avinashelite

A simple join would do this rite , not sure how your joining the tables .

 

Could you share the code details here so that we could identify the issue 

ksomosera10
Creator II
Creator II
Author

Hi,

This is how I join it.

ksomosera10_0-1625636997876.png

 

I know how to use join but I don't know why it shows that result.

avinashelite

Could you please share the column names in each table 

I feel you have similar column name in both the tables e.g. order Year and its blank in one table and have value in another table that is why its causing the 2 rows 

One solution is in each table try to load only the columns without values and then join with the other table.

If it still doesn't work share the sample data will help you out  

ksomosera10
Creator II
Creator II
Author

Yes, I have a similar column name for Table 1 and Table 2. 

And the logic is to join them into one and merge it using the KeyField I've mentioned.

I hope that makes sense.

 

Thanks!

avinashelite

Without sample data its hard to provide the exact solution . Try like below 

Table_A:

Load 

Keyfield,

OrderYear,

OrderMonth,

Source,

ORNumber

from 

TableA;

//note : make sure this columns has data in it 

join(Table_A)
Load 
Keyfield,

SalesYear,

SalesMonth,

Target
from 
TableB;