At times, it is mandatory to use the same set of code at different places in the script. To achieve this, developers will sometimes use a copy and paste approach. However, this makes it difficult to maintain and read the script. It is always advised to create subroutines and then simply call them as and when needed.
In the following recipe, we use subroutines to create QlikView Data (QVDs) file and store them in a specific folder. We also generate fields using various functions within the subroutines, which also helps in auditing the QVD files.
- This recipe makes use of certain functions such as
QVDTablename
,QVDNoOfFields
, andQVDNoOfRecords
, which don't work in the normal script mode in Qlik Sense. Hence, we need to activate the legacy mode by following the steps given in the recipe entitled How to activate legacy mode in Qlik sense in Chapter 1, Getting Started with the Data. - Once the legacy mode is activated, open Qlik Sense Desktop and...