Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

tosandeep10
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
jontydkpi
Not applicable

Re: How use List box selected value in Store Proc parameter ?

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
tosandeep10
Not applicable

Re: How use List box selected value in Store Proc parameter ?

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

Re: How use List box selected value in Store Proc parameter ?

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
Not applicable

Re: How use List box selected value in Store Proc parameter ?

create variable in front end


vAPP =SP



where SP is a listbox contains field values :

"ABC"

'XXX'

etc