Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Join question

Hi there,

I am getting "field not found (Qty)" when I reload this script:

T1:

Load

ProductID,

Price

From ...

T2:

Load

OrderID,

ProductID,

Qty

From ....

Inner Join Load Qty * Price as SalesPrice from T1;

----------------------

How can I join two tables on a calculated column?

Thanks

1 Solution

Accepted Solutions
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

QlikView join is a bit different from a SQL join that we are used to... In SQL, when you join 2 tables, you can instantly use fields from both tables. in QlikView, when you join, it's more like "pouring" data from one bucket into another. During the join load, only the fields from the "source" table are available to you. So, to overcome this limitation, you need to first join the two tables, and then reload the result in memory ("resident load") and make the calculation there.

On the other hand, if the whole purpose of your Join is to bring in a single field (like a price), you are better off using MAPPING load and ApplyMap, to grab the price for each Product, without using the join - it's faster in most cases, and certainly "cleaner" than a join.

cheers,

Oleg

View solution in original post

2 Replies
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

QlikView join is a bit different from a SQL join that we are used to... In SQL, when you join 2 tables, you can instantly use fields from both tables. in QlikView, when you join, it's more like "pouring" data from one bucket into another. During the join load, only the fields from the "source" table are available to you. So, to overcome this limitation, you need to first join the two tables, and then reload the result in memory ("resident load") and make the calculation there.

On the other hand, if the whole purpose of your Join is to bring in a single field (like a price), you are better off using MAPPING load and ApplyMap, to grab the price for each Product, without using the join - it's faster in most cases, and certainly "cleaner" than a join.

cheers,

Oleg

perumal_41
Partner - Specialist II
Partner - Specialist II

please try

T1:

Load

ProductID,

Price

From ...

T2:

Load

OrderID,

ProductID,

Qty

From ....

Inner Join Load Qty * Price as SalesPrice resident T1;