Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
Since I'm learning Qlik coming from a business intelligence background, but from another product, it's been really interesting to see how for lots and lots of different situations, Qlik experts have worked-out a number of best practices, or at least preferred approaches. Could anyone comment if/whether they use these on their jobs or current projects? Thanks!
Some conventions found in QlikView Your Business, Qlik Sense Official Guide, etc. -- Any other good ones?:
Hi Garrett,
this thread could get very interesting.
My belief is that as long are you have conventions that promote software patterns and drive consistency you are on a great path.
I have been using the following:
Field Naming
_ - System fields. i.e. flags or section access fields. e.g. _SECTIONACCCESS
_ID - ID fields i.e. _IDEmployee
m- expression fields i.e. mRevenue - however i have stopped doing this with sense because of the master library
Table Naming
FACT, EMPLOYEE - i like shouting when defining a table.
tempFact - temp prefix for temporary tables
mapCountryCode - map prefix for mapping loads
Variable Definitions
I also externally store variables in the following files.
Hi Garrett,
this thread could get very interesting.
My belief is that as long are you have conventions that promote software patterns and drive consistency you are on a great path.
I have been using the following:
Field Naming
_ - System fields. i.e. flags or section access fields. e.g. _SECTIONACCCESS
_ID - ID fields i.e. _IDEmployee
m- expression fields i.e. mRevenue - however i have stopped doing this with sense because of the master library
Table Naming
FACT, EMPLOYEE - i like shouting when defining a table.
tempFact - temp prefix for temporary tables
mapCountryCode - map prefix for mapping loads
Variable Definitions
I also externally store variables in the following files.
Hi Garrett,
thank you for reading and mentioning QlikView Your Business 0 I'm glad people are learning something from it...
Here are my two cents about naming conventions:
Fields:
- Fields that are likely to be used a Dimensions (Customer, Product, Supplier) should be spelled in the most user-friendly way, with no special characters and no extra qualifiers. This is done to avoid renaming in the Layout.
- Key fields are often being hidden, so it's good to settle on a single Hide Prefix in order to allow easy hiding. The commonly used "%" works just fine.
- All other fields are likely to be used in Expressions. Since most developers prefer typing their expressions (as opposed to using drop-down lists) and relying on IntelliSense auto-completion functionality, it's handy to start them with a common character:
- Starting all "measures" with the #-sign allows you to type # and get a short list of all "measures"
- Starting all "Flags" with the underscore "_" allows you to type _ and get a short list of all flags.
Variables:
All variable names usually start with a lower case letter, followed by a camel-case field name. As a minimum, people use lower case "v" to differentiate variables from fields.
Many developers use different prefix letters for different purposes - c for color, f for filters, e for expressions.
Personally, I like to spell out the whole word instead of remembering what letter is used for what purpose. For example, "c" could be used for Color, or Condition, or Constant. You need to remember your abbreviation strategy...
In my own practice, I use the following:
color_Variable - for colors
exp_Variable - for expressions
filter_variable - for Set Analysis filters
fmt_Variable - for Format strings
...
vVariable - for common, general use Variables, typically carrying a value rather than a formula.
Cheers,
Oleg Troyansky
Upgrade your Qlik skills at the Masters Summit for Qlik - coming soon to Munich, Germany!
Hi Oleg,
Thanks for the informative reply, and of course, also for so much fantastic info. in QlikView Your Business. Also, for any other readers/followers of this thread, I'd certainly add that the book is equally valuable, both QlikView and for those of us interested in Qlik Sense -- the key logic is the same, and equally applicable.
Cheers!
P.s. Thought of one more yesterday: The pipe-character ("|"), which seems to be the preferred special character to use for concatenating composite keys
Thanks, Garrett, for your kind words! I'm glad that the book is adding value!