Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I m trying to execute sql stored procedure with 3 input parameter namely : B_year,B_month,B_type
I want qlikview to prompt me to enter those input parameter whenever i make refresh or some other means.
How can i do that?
Please Help.
The input box popup is a QlikView function and will not work in an SQL statement like that.
You need to place it outside:
LET vYear=INPUT('ENTER YEAR VALUE','INPUT BOX');
LET vMonth=INPUT('ENTER MONTH VALUE','INPUT BOX');
SQL EXECUTE SP_SAMPLE '$(vYear)','$(vMonth)'
Ps. You might not need the quotations around the variables when calling them.. i.e. $(vYear) instead of '$(vYear)'
Hi Murabza,
You can use input boxes to store the input values in variables before passing them as parameters in your stored procedure call.
Example:
Let vParam1 = Input('Enter value for Parameter 1', 'Input box');
Then you just use vParam1 to pass the value.
How to execute stored procedures has been answered several times in the forums, here for example:
Sorry for not being specific.
What i want is when i refresh my qlikview, it must prompt me to put values
i tried the following script which only prompt me to enter value but at the enfd i get an error.
sql
declare
Let
SQL
EXECUTE SP_SAMPLE @year,@month; @year = Input('Enter year value', 'Input box');Let
@month = Input('Enter month value', 'Input box'); @year int,@month int;SQL
DECLARE @YEAR INT, @MONTH INT;
LET @YEAR=INPUT('ENTER YEAR VALUE','INPUT BOX');
LET @MONTH=INPUT('ENTER MONTH VALUE','INPUT BOX');
SQL EXECUTE SP_SAMPLE @YEAR,@MONTH
------------------------------------
The above code gives me error when i execute it,
but when i hard coded the input parameter it goes fine e.g SQL EXECUTE SP_SAMPLE 2008,8
---------------------------
WHAT CAN I DO?
The input box popup is a QlikView function and will not work in an SQL statement like that.
You need to place it outside:
LET vYear=INPUT('ENTER YEAR VALUE','INPUT BOX');
LET vMonth=INPUT('ENTER MONTH VALUE','INPUT BOX');
SQL EXECUTE SP_SAMPLE '$(vYear)','$(vMonth)'
Ps. You might not need the quotations around the variables when calling them.. i.e. $(vYear) instead of '$(vYear)'
Bingo, i finally got the answer i want.
Thank you just isn't enough! You're the best!
Haha, thanks murabza! Glad to be of assistance
Yes it works. Thank you.