Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Hide some variables and naming convention

Hello,

I do have a qlikview file, with a section access enabled. In the same qlikview file, I have many variables for different usage:

- Used within the script. At the end of the script, I delete most of my variable with following code:

Set sVariableName = null()

   There is no problem for this category, as most of these variables are no longer exposed in the qlikview file

- Used for expressions. All my pivots are using variables, and each of these variable references some expression such as:

Set mMeasureA = SUM(MeasureA)

- Used to control the UI. I need some other variables to control the display of some QV Objects and to be used as parameter of a macro (which is calling a WebService). Obviously, I do not want the user to play with these variables.

My Qlikview is made of several tabs. Most of them are considered as default report, with many restrictions. But 1 tab, does not have any restriction, so the user has the flexibility to build his own report. My problem, is that the use can add any object (as a pivot for example) and access all my variables; or even worse add an "Input Box" object and change the values of my variables.

So, the question is: How to mask a set of variables? Not all, as the ones used for expressions are still useful for the users.

I have tried my luck with the section access OMIT, but I think it only works for fields (and not variables)

I need to hide variables (from the 3rd category), not disable them.

By the way, what naming convention do you use for your variables? I was considering the following ones:

- sVariableName, for the ones used in the script

- mVariableName, for expressions based on measures

- wVariableName, for variables used to control the UI (w, for Window)

Let me know your thoughts and how you deal with such case,

Thanks in advance

5 Replies
Not applicable
Author

No one to help me to hide some of my variables?

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

    As per my knowledge there is no provision in qlikview to hide the variables.

   One way is that you keep these variable name and their definitions in excel file and then use them in Qlikview Application.

   This way other users will not be able to change the values of respective variables.

   And for Variable naming, it fully depends upon you, what you want name you want to give. Generally its good practice to give name according to the use of the variable.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
flipside
Partner - Specialist II
Partner - Specialist II

Hi,

I agree with the OP that it would be very useful if variables could be hidden for just this reason.  The only thing that might work for you is to control object visibility via Profile such as ...

Profile:

LOAD * INLINE

[PROFILE,SH01,SH02,SH03,SH04,SH05,SH06,SH07,SH08,SH09,SH10, LB01

ADMIN,1,1,1,1,1,1,1,1,1,1,1

USER,1,1,1,1,1,1,1,0,0,0,0];


And/or manage programmatically ...

set lb = ActiveDocument.GetSheetObject("LB01")

set vis=lb.GetProperties
vis.Layout.Frame.Show.Always = false
vis.Layout.Frame.show.expression.v = "LB01=0"


lb.setproperties vis


I suppose how easy this would be depends on how many objects there are!

flipside

jim_chan
Specialist
Specialist

Hi Solanki,

are you able to provide me steps on how to add variables in the excel, and re-use it back on qlikview?

Rgds,

Jim

mmarchese
Creator II
Creator II

I didn't read your post in detail and I'm using Qlik Sense not Qlik View, but I found a workaround that might help.

I have variables that are used temporarily in my load script and then I'm done with them - things like for loop variables, for instance.  I don't want them showing up on the actual dashboard, so at the end of my script, I put a bunch of lines like this that delete each of the temporary variables one by one:

Let i = ;

Let foo = ;

Let bar = ;

It is certainly less convenient than how you can hide fields automatically based on a certain prefix, but it works.