Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
sudhir0538
Creator
Creator

passing parameter values(selected value from a listbox but not manually entered value) to a stored procedure

Hi Fellas Good Morning,

I wrote a stored procedure and I want to pass a parameter to it.I tried the method of creating a variable and it'll store the data entered by the user at the beginning as a parameter to the stored procedure and it works fine. But it didn't fulfilled my requirement.

Instead of this I want to send the field which is selected by user in the given list box or some other objects in the qlikview document as a parameter to the stored procedure.

Kindly help it out to resolve this.

6 Replies
robert_mika
Master III
Master III

Maybe use t only function

=only(YourFieldInListBox)

Feeling Qlikngry?

How To /Missing Manual(24 articles)

maxgro
MVP
MVP

You can try with the Robert's expression (or similar expression, "=max(YourFieldInListBox)", or "=GetFieldSelections(YourFieldInListBox)") in the variable you already defined and check you get the same result you got with user input. If the result is the same, the stored procedure should work

Peter_Cammaert
Partner - Champion III
Partner - Champion III

In case you want to EXECute the stored procedure during a load script run, you still need to use variables. Because variables can carry values from an interactive QVW session (using the old data set from the previous reload, possibly as data islands) into the next script run of the same document.

The only thing you need to add is a set of field triggers that capture field selections every time the user changes something in one of the "parameter" listboxes. There may be a problem with capturing the "Clear" button, but you could replace that one with a "Clear" button of your own design that has a few extra actions.

If you don't want to figure out the maximum content of these variables to be used when the Celar button is pressed, just clear the variables and check for an empty content in your load script (replace it with an asterisk or some other trick)

Peter

sudhir0538
Creator
Creator
Author

Hello All,

Thanks for your support.

Can you explain me with an example? I tried but I didn't get the desired. Help me to get out of it.

"If user select a value from a list box, it'll act as a parameter to the stored procedure and produce the result and if I select another field then it'll clear the old value and show the values for newly selected field"

sudhir0538
Creator
Creator
Author

Hello All,

Thanks for your support.

Can you explain me with an example? I tried but I didn't get the desired. Help me to get out of it.

"If user select a value from a list box, it'll act as a parameter to the stored procedure and produce the result and if I select another field then it'll clear the old value and show the values for newly selected field"

sudhir0538
Creator
Creator
Author

Hello All,

Thanks for your support.

Can you explain me with an example? I tried but I didn't get the desired. Help me to get out of it.

"If user select a value from a list box, it'll act as a parameter to the stored procedure and produce the result and if I select another field then it'll clear the old value and show the values for newly selected field"