Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Varaiable in SQL WHERE instruction

Hello Everybody,

i'd like to know if it's possible to pass a variable from an inputbox in a WHERE from SQL connection.

Ex:



Load

Input('Valeur dentrée', 'Zone de saisie') as v,

Recno() as r



autogenerate 1;

ODBC CONNECT TO ADX_ADXV140 (XUserI ........................);

LOAD

"XYEAR_0" as "ANNEE",

"XMONTH_0"



as "MOIS",

"BPCINV_0"as "CLIENT",

........



SQL SELECT *



FROM

v140.AUTO.XCUMARTCLI INNER JOIN v140.AUTO.BPCUSTOMER ON v140.AUTO.XCUMARTCLI.BPCINV_0 = v140.AUTO.BPCUSTOMER.BPCNUM_0 WHERE ((v140.AUTO.BPCUSTOMER.REP_0)= ' here the Variable v ' AND XYEAR_0 > 2008)";

Thanks for your answers.



1 Solution

Accepted Solutions
MVP
MVP

Varaiable in SQL WHERE instruction

Hello,

You can force the user to enter a value and then process it in the SQL statement:

LET vWhere = Input('Condition', 'Warning'); LOAD *;SQL SELECT *FROM TableWHERE Condition = $(vWhere);


Take into account that you will have to pass a value for this variable while reloading unattended.

Hope that helps.

3 Replies
MVP
MVP

Varaiable in SQL WHERE instruction

Hello,

You can force the user to enter a value and then process it in the SQL statement:

LET vWhere = Input('Condition', 'Warning'); LOAD *;SQL SELECT *FROM TableWHERE Condition = $(vWhere);


Take into account that you will have to pass a value for this variable while reloading unattended.

Hope that helps.

Not applicable

Varaiable in SQL WHERE instruction

Thanks a lot !!!!

thats work fine Smiley Happy

Not applicable

Varaiable in SQL WHERE instruction

You can go for Macro. Set a trigger for variable onchange event. In its macro function force ActiveDocument.Reload.

But macros have issues with server, hence if your app goes to server then this method is not prefered one.

Community Browser