Document Open Processing

Summary: QlikView OnOpen Document triggers fire after the saved opening sheet is calculated.  That sheet may have some heavy calculations that slow the user’s opening experience.

Maybe you already know this, maybe not.

I commonly use a Document OnOpen trigger to make sure that my Document opens on the correct sheet.  I do this because I can be lazy or sloppy during development and save the document with the wrong sheet open.  What ever I saved with becomes the opening sheet.  I hate to reinstall an app just because I saved on the wrong sheet.

Are there any “gotchas” with doing things this way?

I just noticed (after all these years) that even if my OnOpen trigger opens a trivial or empty sheet, my document can take a long time to open.  Why? Because the data requires a lot of decompression? No.

It’s because objects on the saved sheet are getting calculated and then the OnOpen Activate Sheet is being applied!  If my saved sheet has some heavy objects, I may wait a while for those calculations to complete before the Activate Sheet runs and only then do I see output.

This is also true if I use a “Select in Field” OnOpen trigger to reduce my set to something like the current month.  The trigger fires after opening sheet charts are calculated with the saved state — which is generally all data.

Of course I can leverage this behavior by making sure I save my document with selections that represent a small set, and then refine using an OnOpen trigger.

-Rob

2 thoughts on “Document Open Processing”

  1. I use the on post reload instead. Then it all happens before the user opens it. Also no issues with Ajax not running certain things.

  2. Rob, now I understood why some models are too slow to open (with or without data compression).

    In my mind, first run triggers and then do calculations.

    Not doing calculations before and after triggers…waste of resource.

    Thanks.

Leave a Reply

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