Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
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

Labels (1)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

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";

View solution in original post

3 Replies
maxgro
MVP
MVP

maybe

'$(vTmp)'


what's your variable?

Anonymous
Not applicable
Author

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";

Clever_Anjos
Support
Support

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