Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

rayzac99
New 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
jsf_fasoli
Contributor II

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

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.

5 Replies
jsf_fasoli
Contributor II

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

¿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
New Contributor II

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

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. 

jsf_fasoli
Contributor II

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

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
Valued Contributor III

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

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 ;

rayzac99
New Contributor II

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

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

Community Browser