Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
daveatkins
Partner - Creator III
Partner - Creator III

re-hide objects on reload

My dashboard has hidden sheets for debugging and validation. However, I notice that if I forget to re-hide the objects and publish the dashboard, they are visible to end users. Can I do something in the load script/onload trigger to ensure that when the document reloads, the hidden objects remain hidden?

9 Replies
Peter_Cammaert
Partner - Champion III
Partner - Champion III

Yes, in your Load script you can persistently set a vShowDebugStuff variable to 0 (name it as you wish) likee this:

SET vShowDebugStuff = 0; // Disabled by default

Every conditional show expression of all Debug objects should now carry an expression as simple as

=vShowDebugStuff

If you ever want to inspect your debugging stuff in QV Desktop, use the Variable Overview to set that particular variable to a non-zero value. The next reload (probably on your server) will reset it to 0 before publishing the document.

Best,

Peter

vishsaggi
Champion III
Champion III

Can you share a sample with an example ?

daveatkins
Partner - Creator III
Partner - Creator III
Author

so this would replace the control-shift-S functionality with the practice of "go to variable overview and set value to 1"? Every reload would then reset which could be a bit annoying for developer, but preferable to the current behavior of accidentally deploying debug sheets to production.

daveatkins
Partner - Creator III
Partner - Creator III
Author

upon further reflection...this is not really a viable solution. Every time the developer hits reload, they will have to re-enable the variable. It won't take too long before they just change the load script. That's what I would do.

RonaldDoes
Partner - Creator III
Partner - Creator III

I would then either (and in that order):

  • tell them not to change the script;
  • in the case of really disobediant developers, put it in Hidden Script. That way, only developers with the password to the hidden script will be able to change this parameter.

I've attached an example of the last option. Hidden script password is <supersecret>.

Knipsel.PNG

RonaldDoes
Partner - Creator III
Partner - Creator III

I did. It's attached to the post.

Peter_Cammaert
Partner - Champion III
Partner - Champion III

Another solution could be to keep using this trick, but only activate it in your production environment. Developers can still mess with whatever they don't like, but your published documents are forced to behave or - and this is a safety extension that you can add - they will be denied a reload/update.

How to do this in the simplest manner possible? Use an include file with general setttings at the start of every script. The include file in your production environment contains at least one line more than the other copies, e.g.

SET vShowDebugStuff = 0;

Failure to include this script file comes with a developer-oriented penalty (ranging from "no coffee/pizza for the next 24 hrs" to pulling out fingernails, or something inbetween ). Or more sensibly: some critical settings for a particular environment will be missing (data paths, connection strings ,whatever) or the document will simply refuse to reload. The latter works best if combined with  Ronald's 2nd suggestion here (Hidden Script)

daveatkins
Partner - Creator III
Partner - Creator III
Author

thanks for the suggestions; unfortunately, none of these really fits. My solution is to color the tabs of the hidden sheets red so they are more obvious and I will be less likely to forget to save qlikview while they are still visible.

prieper
Master II
Master II

Why not link to the developer's name?

Show/Hide subject to =WILDMATCH(OSUSER(), '*ATKINS*', ....) should do.

Typically we do add an "*" to the sheetname in order to mark that this sheet is not visible to the public.

Peter