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.

farolito20
Not applicable

Script Error

Help

That's my script and my error window

error.jpg

Let ThisExecTime = ReloadTime();

QV_Table:

LOAD BusinessEntityID,

    ModifiedDate,

    PasswordHash,

    PasswordSalt,

    rowguid;

SQL SELECT BusinessEntityID,

    ModifiedDate,

    PasswordHash,

    PasswordSalt,

    rowguid

FROM AdventureWorks2008.Person.Password

WHERE ModifiedDate >= #$(LastExecTime)#;

 

Concatenate LOAD BusinessEntityID,

    ModifiedDate,

    PasswordHash,

    PasswordSalt,

    rowguid FROM File.qvd (qvd);

 

          STORE QV_Table INTO QV_Table.qvd (qvd);

          Let LastExecTime = ThisExecTime;

5 Replies
Not applicable

Re: Script Error

Have you tested the connection to the Database? And if so, try to find the table "AdventureWorks2008.Person.Password" through the select button under the Data tab.

farolito20
Not applicable

Re: Script Error

OLEDB CONNECT32 TO [Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=AdventureWorks2008;Data Source=COMGAD;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=COMGAD;Use Encryption for Data=False;Tag with column collation when possible=False];

Let ThisExecTime = Date(ReloadTime());

QV_Table:

LOAD BusinessEntityID,

    ModifiedDate,

    PasswordHash,

    PasswordSalt,

    rowguid;

SQL SELECT BusinessEntityID,

    ModifiedDate,

    PasswordHash,

    PasswordSalt,

    rowguid

FROM AdventureWorks2008.Person.Password

WHERE ModifiedDate >= #$(LastExecTime)#;

//       AND ModifiedDate < #$(ThisExecTime)#;

Concatenate LOAD BusinessEntityID,

    ModifiedDate,

    PasswordHash,

    PasswordSalt,

    rowguid FROM QV_Table.qvd (qvd);

//WHERE NOT EXISTS(PrimaryKey);

//

//Inner Join SQL SELECT PrimaryKey FROM DB_TABLE;

If ScriptErrorCount = 0 then

          STORE QV_Table INTO QV_Table.qvd (qvd);

          Let LastExecTime = ThisExecTime;

End If

Not applicable

Re: Script Error

Try to use the variable differently:

Let ThisExecTime = 'Where [ModifiedDate] >=' & Date(ReloadTime());

and then:

SQL SELECT BusinessEntityID,

    ModifiedDate,

    PasswordHash,

    PasswordSalt,

    rowguid

FROM AdventureWorks2008.Person.Password

$(ThisExecTime);

(You can of course use 2 different variables, one for the date(reloadtime) and the second for the string..)


Not applicable

Re: Script Error

You should also make sure that the Date(ReloadTime()) returns the same kind of date as ModifiedDate.

(YYYY-MM-DD or MM/DD/YYYY ect.)

SunilChauhan
Not applicable

Re: Script Error

have u tried this

FROM AdventureWorks2008.Person.Password

WHERE ModifiedDate >='$(LastExecTime)';

hope this helps