Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to use value of the variable in load script?

I want to let users to reload data by company level they selected.

variable:

vCom_L = GetFieldSelections(com_level,',')

Load script:

SQL select company,com_level from Dim_Company

where com_level in $(vCom_L);

SQL select distinct com_level from Dim_Company;

3 Replies
tresesco
MVP
MVP

You can't get the field selection in the script directly like you tried. Have a look at this link , explained very nicely.

sushil353
Master II
Master II

Hi John,

You need to store your selection in a table and then have to reload the application...

otherwise there is no direct way to include the UI variables into script directly.

HTH

Sushil

Not applicable
Author

Hi

There are a few ways of doing this.  I'll quickly list them as you may prefer one over another;

1) Your code above looks almost sound as long as you only allow one  selection on com_Level.  But I'd advise not loading from your SQL DB directly as this may affect performance of your source system.  It would be more efficient and simpler to have this SQL table stored into a qvd and load from this, use formula;

vCom_L= GetFieldSelections(com_Level)

2) Hide all your tabs and only show them after your use has performed a data reduction (i.e. Have them open the fully populated qvw but do not allow them access to any functionality via conditional hides until they have performed this data reduction).

3)  Provide a selection box and a reload button to make the selection easier for you users.  (This is similar to option 1).  I have attached an example so that you may see the logic of the load script.

I hope this helps, let me know how you get on.


Regards


Steve