I want to use a field, present in the primary load, but in another load.
For example:
[Table 1]:
Select
Field1,
Field2
From
Database1
;
[Table 2]:
LOAD:
if Field1(from Table 1) > 0 then 1 as Filter
Select
*
From
Database2
;
I'm looking for the best way to use the Field1
(from Table 1
) in the Table 2
in Qlikview. But it tells me that Field1
is not present in the database.
There are few options but in general its depends on your data:
bring
Field1
intoTable 2
. If there is something common betweenTable 1
andTable 2
then you can to join both tables (or subset of them) and thenField1
will be available in the resulting table. (This depends on your data but for me this is usually the preferred way)create variable(s) that holds specific
Field1
value. For example:In the script above peek() function will return the last loaded value from
Field1
and set the value intovField1
variable, which is then used intoTable 2
load. Bear in mind thatpeek()
returns only one value!Lookup() function can look for a specific value in
[Table 1].Field1
based or not on the current field value fromTable 2
.In the example above
Lookup('Category', 'Product', ProductID, 'ProductList')
will look intoProductList
table and intoCategory
field and will returnProduct
value based on the currently loadedProductID
value. So if there is a common values betweenProductID
andCategory
the result fieldCategoryID
will contains data from the first table.