Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

sql where statment using variable

I am have problem, when I use the variable

let vExecTime='2015-03-25' in a load sql select statment,

sql where statement (WHERE MODIFIED < '$(ThisExecTime)')

return 0 records from sql table while when replace variable with '2015-03-25'  sql select statmen works?

5 Replies
MK_QSL
Not applicable

Re: sql where statment using variable

MODIFIED should be in YYYY-MM-DD format !

Also check < or > depending upon your requirements.

anbu1984
Not applicable

Re: sql where statment using variable

Is it because you used wrong variable name in Sql??

(let vExecTime='2015-03-25' in a load sql select statment,)

sql where statement (WHERE MODIFIED < '$(ThisExecTime)')


bill_markham
Not applicable

Re: sql where statment using variable

Try sql where statement (WHERE MODIFIED < '$(vExecTime)')

Not applicable

Re: sql where statment using variable

anbu got it right! that was the fix;


I am trying to create a QVW that does incremental loads of large SQL tables that get updated daily. 


The scripting in Re: Re: Incremental Load Script

for case 4 worked fine until I added a second set of data (different SQL table) to save a 2nd QVD.  The script runs correctly for the 1st incremental load and creates an updated QVD then drops/ at end of second table right as it starts to store the 2nd QVD that has an incremental load with same scripting in case 2 (Load Insert/Update/Delete).

Not applicable

Re: sql where statment using variable

anbu got it right! that was the fix;


I am trying to create a QVW that does incremental loads of large SQL tables that get updated daily.


The scripting in Re: Re: Incremental Load Script

for case 4 worked fine until I added a second set of data (different SQL table) to save a 2nd QVD.  The script runs correctly for the 1st incremental load and creates an updated QVD then drops/ at end of second table right as it starts to store the 2nd QVD that has an incremental load with same scripting in case 4 (Load Insert/Update/Delete).  typo both are case 4 incremental loads.