Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Multiply two tables

Hi all,

I guess my problem is simply if you know how to do it... I'm trying to multiply two tables in a load script e.g. if in one table I have orders and in another table I have statuses I expect to receive for an order depending on the order type.

Example:

table order:

OrderID     OrderType

1               A

2               B

table status_expected:

OrderType     Status

A                    100

A                    200

A                    300

B                    800

B                    900

expected output:

OrderId     OrderType     Status

1           A                100
1A200
1A300
2B800
2B900

Thanks for your help,

Jens

1 Solution

Accepted Solutions
maxgro
MVP
MVP

If you just want 1 table use this script (with a join)

[table order]:

load * inline [

OrderID     OrderType

1               A

2               B

] (delimiter is spaces);

left join ([table order])

//[table status_expected]:

load * inline [

OrderType     Status

A                    100

A                    200

A                    300

B                    800

B                    900

] (delimiter is spaces);

You can probably get the same result without joining the 2 tables (ie no changes to your script): Qlikview will associate the 2 tables.

View solution in original post

2 Replies
maxgro
MVP
MVP

If you just want 1 table use this script (with a join)

[table order]:

load * inline [

OrderID     OrderType

1               A

2               B

] (delimiter is spaces);

left join ([table order])

//[table status_expected]:

load * inline [

OrderType     Status

A                    100

A                    200

A                    300

B                    800

B                    900

] (delimiter is spaces);

You can probably get the same result without joining the 2 tables (ie no changes to your script): Qlikview will associate the 2 tables.

Not applicable
Author

Thanks, maxgro.

Your first proposal does exactly what I need.