Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Variable Issues

  In Variable Overview I set up vPrevDay.  I then create the following

Bus_Date:

SQL SELECT
Max(BI_DATA_AS_OF_DT) as "Bus Date"
FROM
$(database_owner)
.

$(qvd_name)
;

LET

vPrevDay=

Date(

Peek('Bus Date'),'YYYY-MM-DD');


Drop

table Bus_Date;

error message

ODBC connection failed

Bus_Date:

SQL SELECT

Max(BI_DATA_AS_OF_DT) as "Bus Date"

FROM .BDE_DAILY

Must I create a second ODBC just to add a variable

3 Replies
vardhancse
Specialist III
Specialist III

is $(database_owner). a connection string you are passing

if not we can create .qvs files for the connection strings.

maxgro
MVP
MVP

did you setup a connection to the db before

Bus_Date:

SQL SELECT

.....

if not, some help here

Loading ODBC Data into QlikView

Not applicable
Author

HI.

I think is better first select in SQL and after that LOAD in QlikView. Because the syntax in SQL is different from QlikView.

Next you can add quotes(just in case) signs because in many cases variables are not work correctly without quotes. You can check this with text boxes in layout.

Chek the value for vPrevDay in textbox in the layout.

So you can try with next script:


Bus_Date:

LOAD

     Max(BI_DATA_AS_OF_DT) as "Bus Date"

SQL SELECT

     BI_DATA_AS_OF_DT)
FROM '
$(database_owner)'
.'
$(qvd_name)'

;

LET

     vPrevDay=

                              Date(

                                        Peek('Bus Date'),'YYYY-MM-DD');

Drop

     table

          Bus_Date;

Regards,

Venelin