CompositeKey:
LOAD
AutoNumber(FieldA & '|' & FieldB) as Key,
FieldA,
FieldB
FROM SourceTable;
Basic LOAD Statement
Basic structure of a LOAD statement with aliases and calculated fields.
TableName:
LOAD Field1 as Alias1, Field2, Field1 * 1.1 as CalculatedField
FROM [lib://DataSource/Data.csv]
(txt, utf8, e...
CrossTable(Month, Sales, 1)
LOAD * FROM BudgetGrid.csv;
GENERIC LOAD ID, Attr, Val FROM Data.csv;
SalesSummary:
LOAD
Region,
Sum(Amount) as TotalAmount
FROM SalesData.qvd
GROUP BY Region;
Hierarchy(NodeID, ParentID, Name, ...)
LOAD * FROM Nodes.csv;
StatusMapping:
LOAD * INLINE [
StatusCode, StatusDescription
1, Active
2, Pending
3, Inactive
4, Clo...
IntervalMatch(EventDate)
LOAD Start, End FROM Periods.csv;
// Besser: ApplyMap verwenden
Map: MAPPING LOAD ID, Val FROM Dim.qvd;
LinkTable:
LOAD DISTINCT CustomerID, ProductID FROM Sales.qvd;
CONCATENATE (LinkTable)
LOAD DISTINCT CustomerID, Product...
UniqueCustomers:
LOAD DISTINCT
CustomerID,
Region
FROM [lib://Source/Orders.qvd] (qvd);
TableName:
LOAD Field1, Field2
FROM [lib://Path/File.csv]
(txt, codepage is 1252, embedded labels, delimiter is ';', msq...
LIB CONNECT TO 'ConnectionName';
TableName:
SQL SELECT Field1, Field2
FROM Schema.TableName
WHERE Condition;
TableName:
LOAD Field1, Field2
FROM [lib://Path/File.xlsx]
(ooxml, embedded labels, table is [Sheet1$]);
TableName:
LOAD *
FROM [lib://Path/File.qvd] (qvd);
TableName:
LOAD *
FROM Source
ORDER BY Field1, Field2 ASC;
TableName:
LOAD *
FROM [lib://Source/File.qvd] (qvd)
WHERE Condition;
CountryMap:
MAPPING LOAD CountryCode, CountryName FROM Countries.csv;
Customers:
LOAD
CustomerID,
Name,
Cou...
MasterCalendar:
LOAD
Date($(vMin) + IterNo() - 1) as Date
AUTOGENERATE 1
WHILE $(vMin) + IterNo() - 1 <= $(vMax...
Non-Optimized QVD Load
Any transformation (function, calculation, rename) on a QVD field breaks the optimized read path and is significantly slower.
// Breaks optimization — avoid for large QVDs
TableName:
LOAD SomeFunction(Field1) as Field1
FROM Data.qvd (qvd);
Optimized QVD Load
Super-fast QVD load with no transformations — preserves the optimized read path.
TableName:
LOAD Field1, Field2
FROM [lib://Path/File.qvd] (qvd);
QUALIFY *;
UNQUALIFY CustomerID;
Customers:
LOAD CustomerID, Name FROM Customers.csv;
RawData:
LOAD A, B FROM Source.csv;
TransformedData:
LOAD
A,
B * 2 as CalculatedB
RESIDENT RawData;
DROP TABL...
// Single-line comment
/* Multi-line
comment */
FactSales:
LOAD OrderID, CustomerID, ProductID, DateID, Amount FROM Sales.qvd;
DimCustomer:
LOAD CustomerID, CustomerNa...
Orders:
LOAD OrderID, Date FROM Orders.csv;
Shipments:
LOAD OrderID, Date as ShipDate FROM Shipments.csv;
Keys: LOAD DISTINCT ID FROM Source.csv;
Data:
LOAD *
FROM Large.qvd (qvd)
WHERE EXISTS(ID);
How to Use This Reference
Each card shows the command name, a syntax snippet, and a difficulty badge. Click Details to see the full syntax, a working code example, and links to related commands.
Difficulty Levels
- Beginner: Core commands used in every script (LOAD, SET, LET, DROP).
- Intermediate: Transformations requiring data modeling knowledge (JOINS, KEEPS, ApplyMap, CROSSTABLE).
- Advanced: ETL patterns, optimization techniques, and edge cases (incremental loading, QVD optimization, GENERIC LOAD).
Related Resources
- Qlik Sense Data Modeling Course: 28-article course covering all scripting concepts in depth.
- Qlik Extensions Catalog: Tools for script formatting, QVD viewing, and development.
- Expression Cheat Sheet: Set analysis patterns and chart expression reference.
Frequently Asked Questions
Where do I write load scripts in Qlik Sense?
Open the Data Load Editor from the navigation menu in your Qlik Sense app. Scripts are organized in tabs. Press Ctrl+K, Ctrl+S to save, and click Load data to execute.
What is the difference between LOAD and SQL SELECT?
LOAD reads from files (CSV, Excel, QVD) and supports Qlik-specific transformations (CROSSTABLE, WHERE clauses with Qlik functions). SQL SELECT sends a query to a database via ODBC/OLEDB and returns the result set. You can combine both: a LOAD statement preceding a SQL SELECT lets you transform database results with Qlik functions.
How do I debug a load script error?
Check the script execution progress window for the exact line number. Use TRACE statements to print variable values during execution. For data issues, add a WHERE RowNo() <= 100 clause to test with a small sample before running the full load.