Naming Conventions

As part of script maintenance, it is important that you follow some standardization in the naming conventions in the script. It will help you to understand the code very easily. That is, just by looking at the code, one will be able to find the purpose of the code, if it is standardized.

  • Field names: The field name should be defined such that it can be easily readable by the end users. Most of the times, the table from which the data is pulled in Qlik Sense contains the technical names of the fields, but when using those fields in Qlik Sense scripting, it is important that you change them into more readable form. The name to the field should be given as per the data it contains. For example, if you have the Prod_code field in the Product Table which contains the product code, then you should rename it as Product Code.
  • Key field names: The fields which are used to link two or more tables, either a composite key or a normal key, should be preceded by the symbol like %. It becomes easier to find the linking fields by just looking at the % symbol. For example, the linking field for the sales and budget table can be named as %Sales_Budget_Key.
  • Flag field names: At times you may create some flag fields in the script, depending on the complexity of the code or as needed. These flag fields should also be named such that they can be easily identified. You can use symbol like _before the flag field name. For example, the flag field name can be _Employee active flag.
  • Temporary field names: You must be creating some temporary fields in the script for various calculations. These fields should be identified easily to understand the logic in the code. You can use the tmp or temp keywords at the end of the field name to tag them as temporary fields. For example, Product Category_Temp.
  • Variable names: We all use variables quite frequently in Qlik Sense for various purposes. Though they contains data just like normal fields, they should be named differently so that they can be identified when used at various locations. Generally, the variable names are preceded with a small v. For example, vCount, vMaxDate, and so on.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset