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
Field1intoTable 2. If there is something common betweenTable 1andTable 2then you can to join both tables (or subset of them) and thenField1will 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
Field1value. For example:In the script above peek() function will return the last loaded value from
Field1and set the value intovField1variable, which is then used intoTable 2load. Bear in mind thatpeek()returns only one value!Lookup() function can look for a specific value in
[Table 1].Field1based or not on the current field value fromTable 2.In the example above
Lookup('Category', 'Product', ProductID, 'ProductList')will look intoProductListtable and intoCategoryfield and will returnProductvalue based on the currently loadedProductIDvalue. So if there is a common values betweenProductIDandCategorythe result fieldCategoryIDwill contains data from the first table.