Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Jacob
Contributor III
Contributor III

Combine 2 table filed and create 3th table

HI All,   

I am new to QlikView. Please help

I have two tables and i want combine all filed and create a 3rd table.

I don't have a primary key.

T1

 

COUNTRY
ind
uk
us
aus

 

T2

SALES 
 10
20 
30 
40 

 

T2

 Qty
 1

 

I have to create a 3rd table and I want to combine all filed .

 COUNTRY SALES  Qty
 ind 10 1
 uk 20
 us30 
 aus40 
2 Replies
dplr-rn
Partner - Master III
Partner - Master III

Without primary key i think will be difficult to do withing qlik . how will qlik know Sale of 10 and quantity of 1 is associated with country ind

Whats your data source? why not do this there
miguelbraga
Partner - Specialist III
Partner - Specialist III

Hey there,

 

The only concievable way to achieve this is doing a script like this one:

T1:
LOAD *,
RowNo() as Id
;
LOAD * INLINE [
COUNTRY
ind
uk
us
aus
];

left join

//T2:
LOAD *,
RowNo() as Id
;
LOAD * INLINE [
SALES
10
20
30
40
];

left join

//T3:
LOAD *,
RowNo() as Id
;
LOAD * INLINE [
Qty
1
2
3
4
];

Drop Field Id from T1;
RENAME Table T1 to Table;

 

See the final result:

Screenshot_1.png

See the attached file.

 

Best regards,

MB