Skip to main content

Loading data from a previously loaded table


Loading data from a previously loaded table

You can use the Resident predicate in a LOAD statement to load data from a previously loaded table. This is useful when you want to perform calculations on data loaded with a SELECT statement where you do not have the option to use QlikView functions, such as date or numeric value handling.


In this example, the date interpretation is performed in the Resident load as it can't be done in the initial Crosstable LOAD.

PreBudget: Crosstable (Month, Amount, 1) LOAD Account, Jan, Feb, Mar, … From Budget; Budget: Noconcatenate LOAD Account, Month(Date#(Month,’MMM’)) as Month, Amount Resident PreBudget; Drop Table PreBudget;
Tip: A common case for using Resident is where you want to use a temporary table for calculations or filtering. Once you have achieved the purpose of the temporary table, it should be dropped using the Drop table statement.

Resident or preceding LOAD?

In most cases, the same result can be achieved by using a preceding LOAD instead, that is, a LOAD statement that loads from the LOAD or SELECT statement below, without specifying a source qualifier such as From or Resident that you would normally do. A preceding LOAD is generally the faster option, but there are some cases where you need to use a ResidentLOAD instead:

  • If you want to use the Order_by clause to sort the records before processing the LOAD statement.
  • If you want to use any of the following prefixes, in which cases preceding LOAD is not supported:
    • Crosstable
    • Join
    • Intervalmatch