Qlikview Inner Keep

This post demonstrates the use of the Qlikview Inner Keep Load Script prefix. For my use case, I am loading an Inline table with sample transaction data, then using the Inner Keep prefix in a separate code block, which references the resident table.  The result will filter down or reduce the initial table content, to only include records where the maximum quantity for a given record is retained in Qlikview storage.

Qlikview Version: Personal Edition 12.0.20100.0 SR2 64-bit Edition (x64)
OS: Windows 10

Setup – Qlikview Inner Keep

First, setup a new QVW and load the following sample data:

Load the data, then add a Table Box and review the content:

Qlikview Inner Keep

Next, add the following code block to your Load Script:

This block will use the resident table “Transactions”, and group by the ProductID column, loading the MAX Quantity for each ProductID into table “filter”.  By using the Inner Keep prefix to the load statement, Qlikview will then filter down the resident table “Transactions”, to only include matching records to the second table “filter”.  This second table “filter” is created and loaded, and only matching records on the key ProductID are kept in the “Transactions” table.

Once the second script code block above is executed, I then drop the second table “filter”, leaving only the original table “Transactions”, filtered down to include only ProductIDs based on the MAX Quantity.

The resulting content will now look like the following in your Table Box:

Qlikview Inner Keep

Looking closer at ProductID = 1, the before and after content in table “Transactions” is depicted below:

Qlikview Inner Keep

The only record remaining for ProductID = 1 is where the Quantity = 6, which was the MAX Quantity from our Inner Keep load script block.

Please comment if you have any questions or would like to see any additional examples.  Enjoy!



Additional Content

Check out more examples by visiting my Home Page

Here you will find topics covering  Qlikview  SQL Server  Excel VBA



Leave a Comment