Preceding load on preceding load
Within the QlikView scripting language, there is the ability to write Load
statements on top of each other; such statements are known as preceding loads. This is quite a useful feature as it allows additional script to be applied without a lot of extra work.
However, there is quite a bit of processing overhead involved when you use this feature, and in most cases, it is more efficient to reload the table again (using resident) than it is to use preceding load on preceding load. Alternatively, if the reason for the preceding load on preceding load is to reuse a calculated field, it can be more efficient to reproduce the calculation again.
Consider the following example:
Product_Source: LOAD *, Price + VAT as TotalPrice ; LOAD [Product Code], Price, Price * 0.20 as VAT FROM
Here, we calculated the VAT
figure, stored it as a field, and then in the next part of the LOAD
, we added the VAT
figure to the price, giving us a TotalPrice
field. This is fairly...