Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
rayzac99
Partner - Contributor II
Partner - Contributor II

How to create row for each record combination in two tables?

I have two tables.  One is a list of dealers.  The other is a list of products.  I want to create one table that has a row for each dealer and each product.   What is the best way to do this in Qlik Sense?

Table 1 (dealer)

A

B

C


Table 2 (products)

1

2

3

Result table

A     1

A     2

A     3

B     1

B     2

B     3

C     1

C     2

C     3

Thanks in advance!

1 Solution

Accepted Solutions
Anonymous
Not applicable

Load

   ...

From Table 1 (dealer)

Join

Load

     ...

From

Table 2 (product)

That would do a cross join. If you need to relate specific products to specific vendors you need to create a key field between the two tables.

View solution in original post

5 Replies
Anonymous
Not applicable

¿How are the two tables relating to each other? ¿Which is the key?

¿Are you asking to do it by script or in the frontend?

Regards, Josefina

rayzac99
Partner - Contributor II
Partner - Contributor II
Author

They are not related now.  I would like to do this by script to create a table so I can then relate it to other existing tables. 

Anonymous
Not applicable

Load

   ...

From Table 1 (dealer)

Join

Load

     ...

From

Table 2 (product)

That would do a cross join. If you need to relate specific products to specific vendors you need to create a key field between the two tables.

pradosh_thakur
Master II
Master II

Try this too

load concat(Field2,',') as A;

LOAD * INLINE [
Field2
1
2
3
];
let x= peek('A');

r:
LOAD * INLINE [
Field1
A
B
C
];

load Field1 as Field4,subfield('$(x)',',') as Field3
resident r ;

Learning never stops.
rayzac99
Partner - Contributor II
Partner - Contributor II
Author

Thanks.  This appears to have worked as I need it to.