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 use List box selected value in Store Proc parameter ?

Hi All,

I have a list box having two values (ABC, XYZ). I am using a Store Procedure to bind the chart.

SQL

EXECUTE RP_ERRORREPORT @APP;

@APP is either =''ABC' or 'XYZ' or may some other values.

I want to use this @APP value in my store procedure. So I would like to know how I can use the List box selected value in above store procedure.

Thanks

Sandeep

4 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

If you need to do this in the load script, then you can't use the list box selection as the list box does not "exist" until the load script completes. To get the value to the load script, you can set a variable using an input box, or create a trigger on the list box field to save the current selection value in a variable - and then use the variable in the script. Something like:

SQL EXECUTE RP_ERRORREPORT '$(vAppCode)';

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Anonymous
Not applicable
Author

Thanks for the Answer.

Here is full scenario.

I have a List box or may be some other controls which have multiple values.

e.g. ABC,XYX, XXX, EEE, DDD etc

In script

I have created a variable vAPP

LET vAPP ='ABC';

now I passed this variable to my SP.

SQL EXECUTE RP_ERRORREPORT '$(vAPP)'; === SQL EXECUTE RP_ERRORREPORT 'ABC';

it works fine and load data in the chart.
But when I select some different value from List box say 'XXX', then I want variable vAPP value changed to 'XXX' and my SP called again.

SQL EXECUTE RP_ERRORREPORT 'XXX' and load the data on chart based up on my current value of vAPP.

Thanks

Sandeep

Not applicable
Author

Hi,

1) Create a variable that will be equal to the Listbox, sth like

vMonth = "=Month"  (should be a formula)

2) As you already did, use this variable into your script.

3) Create a button or a trigger action that will reload.

Fabrice

preminqlik
Specialist II
Specialist II

create variable in front end


vAPP =SP



where SP is a listbox contains field values :

"ABC"

'XXX'

etc