Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
yogitamehta10
Creator
Creator

Data modelling

HI All,

I just need some clarification.

I had two tables  in which most of the fields  were same but some were different mainly all the dimensions fields were same .

I had to  merge in to in a single table  where for each dimension like brand if we have value in both  the table then it should come otherwise blank.

I tried to achieve it by concatenation but some of the reason it was giving duplicate records then I tried full join but  then  the issue I was getting is if suppose I select brand   from table 1  then it will not show the the data of brand which are in table 2

for this reason I used link table.

now I have

table 1

dim1

dim2

dim3

dim1&’’&dim2&’’& dim3

datafield1

datafield2

from abc;

outerjoin(table1)


table2

dim1

dim2

dim1&’’&dim2&’’& dim3

datafield3

datafield4

from xyz

now what I’m doing

linktable:

dim1

dim2

dim1&’’&dim2&’’& dim3

from abc

concatenate (linktable)

dim1

dim2

dim1&’’&dim2&’’& dim3

from Xyz


is this right approach

6 Replies
yogitamehta10
Creator
Creator
Author

any response??

Anil_Babu_Samineni

Looks good.. Do you feel any bad or simple asking? Create one key and do concatenate and then Link table, May be?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
yogitamehta10
Creator
Creator
Author

Do I need to join table 1 and table 2  or I don't need to

suryaa30
Creator II
Creator II

Simple concatenate would do. I

If you you say that you are getting duplicates what exactly do you mean? are you not able to identify the records from which table it has come? because duplicates arise only when you have 2 records with all fields matching after concatenation but they are from different table originally.

In that case add a dummy field indicating the origin table before concatenate.

table 1:

dim1

dim2

dim3

dim1&’’&dim2&’’& dim3

datafield1

datafield2

'table1' as tableIdentifier

from abc;


Concatenate(table1)


table2:

dim1

dim2

dim1&’’&dim2&’’& dim3

datafield3

datafield4

'table2' as tableIdentifier

from xyz






yogitamehta10
Creator
Creator
Author

no concatenation will not work for me as I  have id field in both the table

table 1

id

1

2

3

table 2

id 1,2,3,4,

so if I have   concatenate it it will generate overall 7 rows instated it should be only 4 rows.

Anil_Babu_Samineni

If you get any Synthetic keys, May be required to use JOIN or i don't think so ?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful