Reusing chart expressions

We have mentioned this previously. If you need to do repeated calculations, it is better to do these in the script and create extra fields there. However, there are times when this may not be possible. One way that would appear to solve this issue when using a Chart object is to use a previously calculated Label expression in other expressions.

On the surface, this would appear to be more efficient, and it certainly makes the script easier to read; in practice, there is no speed advantage, and in most tests, it works slightly more slowly. It is, therefore, more efficient to duplicate this part of the expression again.

Have a look at this simple example:

Here, to show the TAX figure, we will use the following expression: ...

Get QlikView Unlocked now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.