ABC: Always Be Closing

By Barry Harmsen

Always Be ClosingA very short tip on writing QlikView expressions that might save you a lot of headaches. In my last online training on Set Analysis (another one coming up this week) I showed a simple technique that I use when writing expressions in QlikView, especially when they contain nested functions. Based on the feedback, it seemed to resonate quite well with the attendees and not everybody was aware of this technique, so I thought I might share it with you as well.

It can simply be summarized as: Always Be Closing.

Whenever I write an expression that contains a parenthesis (or curly bracket/chevron/whatever) that also needs to be closed, I immediately close it and place the cursor one step back. Or, to show it visually (in slow mo):

This way, you’ll never need to think about how many parentheses/etc. you need to close your expression. Of course,  this technique also works for Excel, SQL or any programming language.

As a follow-on tip, whenever I have to ‘decipher’ a nested expression within QlikView, I work inside-out. Start with the inner-most function, figure out what it does and what value(s) it returns, then move on to the function that uses the output of the first function, figure out what that does, and so on.

About The Author

Barry Harmsen

Hi there, I'm Barry and I'm a Business Intelligence Consultant at Bitmetric and based in the Netherlands. Originally from a background of 'traditional' Data Warehousing, Business Intelligence and Performance Management, for the past 10 years I have been specializing in Qlik and a more user-centric form of BI. I have done numerous QlikView and Qlik Sense implementations in many different roles and industries. In 2012 I co-authored the book QlikView 11 for Developers. You can follow me on Twitter at @meneerharmsen.

One comment

  • 1
    Jerome Couzy
    November 6, 2014 - 11:04 | Permalink

    Very good tip, that I have learned to follow while working with QlikView over time!

    I would also add the fact that spreading a comlpex nested if expression over on several lines and indenting right within the expression makes the expression MUCH easier to debug / understand later on.

  • Leave a Reply

    Your email address will not be published. Required fields are marked *

    Read previous post:
    QlikView Set Analysis Training
    Online training: QlikView Set Analysis

    Just a quick heads-up about a new online training that Miguel García and I are offering: Set Analysis. We delivered...

    Close