Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Use a variable in sql select

I set a variable at the beginning of my script, and I would like to assign this variable to every row of data in my sql select statement.

The variable is called vTmp and this is how I am trying to incorporate it but it is not working.

LOAN:

SQL SELECT

    "Account_Phone",

    "Account_Type",

    "Risk_Raiting",

    $(vTmp)

FROM "database".dbo."table";

Is this technique possible?

Thanks

1 Solution

Accepted Solutions

Re: Use a variable in sql select

You may need to use  Preceding Load something like this :

LOAN:

Load

     *

    $(vTmp)

;

SQL SELECT

    "Account_Phone",

    "Account_Type",

    "Risk_Raiting",

    $(vTmp)

FROM "database".dbo."table";

3 Replies
MVP
MVP

Re: Use a variable in sql select

maybe

'$(vTmp)'


what's your variable?

Re: Use a variable in sql select

You may need to use  Preceding Load something like this :

LOAN:

Load

     *

    $(vTmp)

;

SQL SELECT

    "Account_Phone",

    "Account_Type",

    "Risk_Raiting",

    $(vTmp)

FROM "database".dbo."table";

Employee
Employee

Re: Use a variable in sql select

It´s possible, what is the content of your variable?

Community Browser