Qlik resident load examples 

  • How-Tos FAQs
  • November 3, 2020
Get Started Transforming Your Data in Snowflake - feature img

Qlik “resident load” examples 

What are some Qlik resident load examples? How does “resident load” differ from the preceding load?

A Preceding Load Statement feature allows one to load a table in one script and define several successive transformations. The data source is reading the data.

The word “resident” means that the RAM loads the data. So one loads the data from a previously loaded table. Using a resident load statement also enables Qlik functionality allowing the statement to use Qlik Syntax.

A Preceding LOAD Statement:

Transactions:
LOAD *,
Year(TransactionDate) AS Year,
MonthName(TransactionDate) AS MonthYear,
Week(TransactionDate) AS Week;

SELECT
TransactionID,
TransactionDate
FROM Transactions;

Note: The LOAD statement does not contain any FROM or RESIDENT referencing a source for that statement,

The source of the load is the SELECT statement to the data source.

A Resident LOAD Statement:

Transactions:
LOAD *
FROM Data;

CurrentYearSales:
LOAD Customer,
SUM(Sales) as [Total Sales]
Resident Transactions
WHERE Year(TransactionDate) = $(vCurrYear);

PreviousYearSales:
LOAD Customer,
SUM(Sales) as [Total Sales]
Resident Transactions
WHERE Year(TransactionDate) = $(vPrevYear);

More Resident LOAD Examples:

In the example where an excel file loads the table Sample_Data:

Sample_Data:
LOAD [Dimension A],
[Dimension B],
[Measure X]
FROM [lib://Data/Sample Data.xlsx]

 

Now make modifications to the same table using Qlik syntax; you can use resident load and drop the original table.

New_Table:
LOAD [Dimension A],
[Dimension B],
[Measure X]*365 as [Yearly Measure]
Resident Sample_Data;

Drop Sample_Data;

OR

New_Table:
LOAD [Dimension A],
[Dimension B],
SUM([Measure X]) as [Total Measure]
Resident Sample_Data;

Drop Sample_Data;

Be cautious not to load a table with ALL the same fields as the original table; Qlik will automatically concatenate any tables containing ALL the same field names. Avoid this by adding NoConcatenate at the beginning of the LOAD Statement:

New_Table:
NoConcatenate
LOAD [Dimension A],
[Dimension B]
Resident Sample_Data;

Up Next: Learn Qlik Date Conversion for SAP

Related Posts

Top 5 Snowflake tools for Analysts- talend

Top 5 Snowflake Tools for Analysts

  • Ndz Anthony
  • February 26, 2024