The goal of every QlikView developer is to do as little work as possible. When you notice that you are writing the same instructions in multiple app scripts, the notion of re-use is a red flag that flies with great fervor. QlikView’s Include statement provide just such an ability.
The advantages of re-using scripts between multiple apps has several advantages:
- Complex scripts can be used by multiple people with superficial knowledge of the script’s logic.
- Include files ensure business process consistency when performing similar actions across multiple apps.
- Include files expedite script maintenance because the script need only be updated once (in the Include file) and all scripts pointing to the file will automatically incorporate the updates the next time a Reload is executed.
As with anything in life, every “pro” must be accompanied by a commensurate “con”. In this case, the risk of using Include files to re-use script code lies in the fact that the file containing the script must remain in the same location and the file’s name must remain unchanged. If either of these two events occurs, the portion of the script pointed to by the Include statement will not execute.