Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor III
Contributor III

How to create a table resulting of a cartesian product

Hi everybody,

in a Qlikview script I would like to create a table resulting of a cartesian product.

The first table contains Products :

product_id, product_name

1                  AAAA

2                  BBBB

The second table contains Countries :

country_id, country_name

FR              France

ES              Spain

Il would like a table as :

product_id, product_name, country_id, country_name

1                  AAAA                 FR              France

1                  AAAA                 ES              Spain

2                  BBBB                 FR              France

2                  BBBB                 ES              Spain

I tried using "outer join" but the result is :

product_id, product_name, country_id, country_name

1                  AAAA                 -                 -

2                  BBBB                 -                 -

-                 -                          FR              France

-                  -                         ES              Spain

Can someone help me to have the expected result ?

Thanks in advance

1 Solution

Accepted Solutions
Highlighted
Champion
Champion

Hi,

you should use left join or right join

see attached

View solution in original post

4 Replies
Highlighted
Champion
Champion

Hi,

you should use left join or right join

see attached

View solution in original post

Highlighted
Creator II
Creator II

try this...

load * inline [
product_id, product_name

1,AAAA

2,BBBB

]
;
join
load * inline [
country_id, country_name

FR,France

ES,Spain
]
;

Highlighted
Contributor III
Contributor III

Thanks for your answer. It works.

In fact my problem was with the product table load and not with the join.

Highlighted
Contributor III
Contributor III

Thanks for your answer. It works.

In fact my problem was with the product table load and not with the join.