Dynamic Lookup Table Use
Learn how to use dynamic external data from versioned Lookup Tables to drive rule-based calculations in a Decision Table, ensuring the logic always references the latest active catalog version.
David Škarka
Template author
This project simulates a rule system designed to calculate the final price of a product by first looking up its base price and name, and then applying a tiered discount based on that base price.
The logic is contained within a Decision Table that utilizes an external Lookup Table containing the product catalog.
Solution Components:
A Lookup Table named
Product Codesstores the complete product catalog, including theproductCode(primary key),productandprice. It has two versions:Version 1 (Published): The active price list currently used for all calculations.
Version 2 (Pending): A newer price list awaits publication.
A Decision Table named
Product Priceperforms the core logic (attention: change the strategy of execution to First Match). It takes aproductCodeas input and performs the following:Looks up the
priceandproductfrom the latest active version of theProduct CodesLookup Table.Applies a discount percentage to the base price to calculate the
finalPricebased on the product's price range.Returns the
productname and the calculatedfinalPrice.
Use this template to learn how to:
Reference Active Versions: How to use the
LOOKUP_VALUEfunction with the third parameter set to0to automatically fetch data from the latest active version of an external Lookup Table.Handle Edge Cases: How to include non-price error rows using
LOOKUP_EXISTSand an ELSE condition to provide informative outputs for invalid or unlisted product codes.
More Templates
See Other Templates
A/B Testing
Discover a simple way to assign a test group for performing A/B Testing on your decisions.
Risk Based Pricing
Discover a simple way to apply a suitable Risk Based Pricing matrix based on a type of client.
Eligibility and Policy Rules
Discover a simple way to define and execute various sets of rules and get the final decision outcome.