Qlik Sense Data Modeling: The Architecture That Defines Whether Your BI Scales or Collapses - featured image

Publications

Qlik Sense Data Modeling: The Architecture That Determines if Your BI Scales or Collapses

Hector Pincheira

Hector Pincheira

CIO | CTO
Digital Strategy & Technology Innovation

items

The data model that nobody reviews... until everything crashes

There’s a conversation that inevitably comes up in every company that implements QlikSense without architectural planning: «Why does the dashboard take 40 seconds to load?», «Why do we have duplicate values?», «Why did everything break when I added a new data source?». In 90% of cases, the answer is always the same: the Qlik Sense data modeling It was improvised, not designed. And an improvised model doesn't scale.

The statistics are clear: a flat, denormalized table with 50 columns can make your app 10 times slower than the same data structured as a star schema with optimized tables. Well-implemented QVDs load between 10 and 100 times faster than direct database queries. They aren't marginal improvements. They are the difference between a BI tool that gets used and one that gets avoided.

Qlik Sense data modeling - three-layer architecture and star schemaQlik Sense data modeling - three-layer architecture and star schema
Data architecture is not a technical detail. It is the foundation upon which your entire analytical capability rests.

The Real Problem: A Bad Data Model Destroys BI ROI

I've reviewed BI projects where $$80,000 was spent on licenses, servers, and consulting, and the end result was a dashboard that took 2 minutes to open. Users would leave before it finished loading. The tool itself was excellent. The data model was a disaster.

The symptoms are known to any experienced implementer: synthetic keys (the famous tables with the yellow key icon), circular references, fact tables with embedded dimensions, load scripts that mix business transformations with data extraction, and QVD files without any incremental update strategy. Each of these problems has a measurable cost in performance and user trust.

According to the DataStackHub Business Intelligence Statistics 2025-2026 report, the 43% of BI projects fail in achieving sustained adoption. The number one cause is neither a lack of data nor business complexity: it is the accumulated technical debt in the data model that makes maintaining and evolving apps prohibitively costly.

The Solution: Three-Tier Architecture with QVDs

Why the three-tier model is the professional standard

The three-tier architecture is the pattern that separates responsibilities and allows each part of the system to be independently maintainable, testable, and scalable. It is not a personal preference: it is the way senior QlikSense implementers structure their projects in production.

// ===== TIER 1: EXTRACTION (RAW QVD) =====
// Only extracts. Does not transform. Does not filter.
// One script per data source.
[Ventas_RAW]:
LOAD
    FechaDocumento,
    NumeroDocumento,
    CodigoCliente,
    CodigoProducto,
    Cantidad,
    PrecioUnitario,
    CostoUnitario
FROM [lib://BBDD_ERP/ventas] (odbc, table is [dbo].[vw_Ventas]);
STORE [Ventas_RAW] INTO [lib://QVD_Raw/Ventas_RAW.qvd] (qvd);

// ===== TIER 2: TRANSFORMATION (CLEAN QVD) =====
// Business rules live here. Only reads Tier 1 QVDs.
[Ventas]:
LOAD
    Date(FechaDocumento) AS Fecha,
    NumeroDocumento AS NroDoc,
    CodigoCliente AS CodCliente,
    CodigoProducto AS CodProducto,
    Cantidad,
    PrecioUnitario,
    CostoUnitario,
    Cantidad * PrecioUnitario AS VentaBruta,
    Cantidad * CostoUnitario AS CostoVenta,
    (Cantidad * PrecioUnitario) - (Cantidad * CostoUnitario) AS MargenBruto,
    // Derived fields for the master calendar
    Year(FechaDocumento) AS Año,
    Month(FechaDocumento) AS MesNombre,
    Month(FechaDocumento) AS MesNum,
    'Q' & Ceil(Month(FechaDocumento)/3) AS Trimestre
FROM [lib://QVD_Raw/Ventas_RAW.qvd] (qvd);
STORE [Ventas] INTO [lib://QVD_Clean/Ventas.qvd] (qvd);

// ===== TIER 3: APP (FINAL LOAD) =====
// The app only reads from Tier 2 QVDs. Never directly from the DB.
[Ventas]:
LOAD * FROM [lib://QVD_Clean/Ventas.qvd] (qvd);
💡 Key point: The hidden benefit of layer separation is data source independence. If tomorrow you migrate from SQL Server to SAP or any ERP, you only modify Layer 1. The Layer 3 apps are unaware of the change. That is architectural resilience.

Star Schema: The Structure That Makes QlikSense Fly

Qlik Sense has an associative engine that works optimally with a star schema model: a central fact table (transactions, sales, movements) surrounded by dimension tables that explain it (customers, products, dates, salespeople). This model minimizes RAM, speeds up calculations, and eliminates synthetic keys that degrade performance.

// FACT TABLE: Only foreign keys + numeric metrics
// No descriptive fields. No attribute duplication.
[FactVentas]:
LOAD
    CodCliente,         // FK -> DimCliente
    CodProducto,        // FK -> DimProducto
    FechaKey,           // FK -> DimFecha (YYYYMMDD format as number)
    CodVendedor,        // FK -> DimVendedor
    CodSucursal,        // FK -> DimSucursal
    VentaBruta,
    CostoVenta,
    MargenBruto,
    Cantidad
FROM [lib://QVD_Clean/Ventas.qvd] (qvd);
// DIMENSION DATE: The master calendar
// This is the most important component of the model.
// Automatically generates all temporal attributes.
[DimFecha]:
LOAD
    Date(TempDate) AS Fecha,
    Year(TempDate) AS Año,
    Month(TempDate) AS MesNombre,
    Month(TempDate) AS MesNum,
    'Q' & Ceil(Month(TempDate)/3) AS Trimestre,
    Week(TempDate) AS NumSemana,
    WeekDay(TempDate) AS DiaSemana,
    Day(TempDate) AS NumDia,
    If(TempDate <= Today(), 1, 0) AS EsPasado,
    If(Year(TempDate) = Year(Today()), 1, 0) AS EsAñoActual,
    // Numeric key for the fact table
    Year(TempDate)*10000 + Month(TempDate)*100 + Day(TempDate) AS FechaKey
;
LOAD
    Date(MinDate + IterNo() - 1) AS TempDate,
    MinDate,
    MaxDate
WHILE Date(MinDate + IterNo() - 1) <= MaxDate;
LOAD
    Min(Fecha) AS MinDate,
    Max(Fecha) AS MaxDate
RESIDENT FactVentas;
DROP FIELD TempDate, MinDate, MaxDate FROM DimFecha;
Qlik Sense Data Modeling - Star Schema and Dimension TablesQlik Sense Data Modeling - Star Schema and Dimension Tables
The star schema is not just a technical recommendation. It is the architecture that makes fast and unambiguous multidimensional analysis possible.

Incremental Load with QVDs: The Fuel of Scalability

Incremental loading is the pattern that allows an app with millions of records to refresh in minutes, not hours. Instead of reloading everything from the database on each execution, you only read new or modified records and concatenate them to the existing QVD.

// INCREMENTAL LOAD - Professional Template
// Step 1: Read the date of the last record in the existing QVD
LET vLastDate = Peek('Date', -1, 'Sales_Temp');
// If the QVD exists, load the newest records
IF IsNull(vLastDate) THEN
    // First load: retrieve everything
    [Sales_NEW]:
    SQL SELECT * FROM dbo.vw_Sales;
ELSE
    // Incremental load: only the new records
    [Sales_NEW]:
    SQL SELECT * FROM dbo.vw_Sales
    WHERE DocumentDate > '$(vLastDate)';
END IF
// Step 2: Load the existing QVD (only records prior to the cutoff)
[Sales_OLD]:
LOAD * FROM [lib://QVD_Raw/Sales_RAW.qvd] (qvd)
WHERE Date < '$(vLastDate)';
// Step 3: Concatenate both tables
CONCATENATE ([Sales_OLD])
LOAD * RESIDENT [Sales_NEW];
RENAME TABLE [Sales_OLD] TO [Sales];
DROP TABLE [Sales_NEW];
// Step 4: Overwrite the QVD with the updated set
STORE [Sales] INTO [lib://QVD_Raw/Sales_RAW.qvd] (qvd);
💡 Key point: ApplyMap() is the function that replaces heavy JOINs in the script. It creates an in-memory mapping dictionary and applies a key-value lookup much more efficiently than any JOIN on large tables. Use it to enrich the fact table with dimension attributes without creating unnecessary associations.

Business Impact: What a Good Model Means

A distributor company I worked with had its QlikSense app with load times of 3-4 minutes and a nightly refresh that took 6 hours. After redesigning the model with a three-layer architecture, star schema, and incremental load, the app's load time dropped to 8 seconds and the nightly refresh went from 6 hours to 22 minutes.

The impact on the business was immediate: the management team began using the dashboard in their morning meetings—something that had previously been impossible because «it never loaded in time.» The investment in redesigning the model (3 days of work) generated an estimated return on productivity of $$15,000 annually from recovered waiting time alone.

According to data from the BI Statistics Report 2025, organizations with mature BI architectures achieve a reduction of 37% during development of new apps and of the 52% in Incidents Involving Incorrect Data. Architecture is not overhead, it's an investment.

Common Errors in Data Modeling

⚠️ Common error: Connecting the app directly to the transactional database in production, without a QVD layer. Each user who opens the app generates real-time queries that compete with the ERP operations. This is a performance and availability risk for the business.
⚠️ Common error: Create join keys using descriptive text fields (customer name, product name) instead of numeric keys. Text-based joins are slow and fragile: an extra space or a change in capitalization breaks the association without any warning.
⚠️ Common error: Ignore the synthetic keys that QlikSense automatically generates when two tables share more than one key. Synthetic keys consume additional memory and slow down the associative engine. They must always be resolved using link tables or by renaming fields.
⚠️ Common error: Do not version load scripts. A QlikSense script is critical business code. Without version control, there is no way to know what changed, when, and why an app started returning different results.

Implementation Best Practices

Document the visual model before writing a single line of script. The Qlik Sense Data Model Viewer is your validation tool, not your discovery tool. Define on paper (or Lucidchart) how the tables will relate before writing the code. A visualized model before coding saves hours of debugging.

Use standardized names for the keys. Define a convention and apply it without exception: Customer Code in all scripts, never cod_cli, CustomerID, o Customer ID in the same app. Field name consistency is what makes QlikSense's associative engine work automatically and without ambiguity.

Always include a load date field in your QVDs. Add Today() AS FechaCarga in each extraction script, it allows you to audit when each table was updated, diagnose synchronization issues, and build data quality reports for users.

Qlik Sense data modeling - scalable architecture and best practicesQlik Sense data modeling - scalable architecture and best practices
A well-architected model in QlikSense is the difference between a BI project that evolves and one that freezes in time.

Strategic Conclusion: The Model is the Product

In the successful BI projects I have implemented, there is a recurring pattern: the time invested in designing the Qlik Sense data modeling Before developing any visualization, it is always retrieved multiplied. The model is not the backend of BI. The model is the product. When the model is robust, apps are built quickly, work consistently, and scale without drama. When the model is fragile, every improvement is a crisis.

The three-tier architecture, star schema, incremental load, and QVD strategy are not academic concepts. They are design decisions with a direct impact on how long it takes your managers to get the information they need to run the company. And that time has a cost that can be measured.

Do you want to take your BI strategy to the next level? In hectorpincheira.com you will find more strategic content on how to turn technology into a real competitive advantage for your organization.

A good data model does not guarantee data-driven decisions. I explain why in The Semmelweis Reflex: Why Data Doesn't Save Companies That Refuse to Look.

Most Read

QlikSense Hierarchy: parent-child chart of accounts expanded by levels
QlikSense Hierarchy: the Chart of Accounts That Doesn't Add Up
QlikSense Sum TOTAL: share of each family over the total
QlikSense Sum TOTAL: the Percentage That Changes When You Filter
SAP Business One Inventory Revaluation - featured image of the tutorial
SAP Business One Inventory Revaluation: Fix Wrongly Loaded Costs
Empty chamber with wooden benches: the counterweight that required being present to be used
The Veto You Had to Say in Person: Your Decisions With No Counterweight
SAP Business One customizations - featured image of the pre-upgrade audit tutorial
SAP Business One Customizations: Pre-Upgrade Audit
SAP Business One Customer Concentration - featured image of the tutorial
SAP Business One Customer Concentration: Measure Your Risk with SQL

RELATED ARTICLES