Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
shyamcharan
Creator III
Creator III

Code works in 12.10 but not in 12.40 after upgrade

Hi Experts,

We recently upgraded from 12.10 to 12.40 version of QlikView.

Below is the code that works fine in 12.10 but not in 12.40. It throws unknown statement error.

Seeking Qlik Support help but not much help. Your help here is highly appreciated.

Attached are the error messages that I receive and the actual qvc.qvs file that I use while generating the QVD's using the qvdGenerator.qvw. This generator uses an excel file to get the list of tables names and the load code.

//==========================================================//==========================================================// Execute the SQL Select.//==========================================================

[$(Qvc.Loader.v.Tablename)]: // vTablename is set by the IncrementalSetup routine.

Rem; // Fix syntax error from table label with variable // If LOAD Statement provided, use it

IF len('$(_qvctemp.den.loadStatement)')>0 THEN

    $(_qvctemp.den.loadStatement);

ELSE // No LOAD Statement, build a SQL SELECT 

       IF $(Qvc.Loader.v.CreateExtractTimestampField) THEN

                LOAD *, now(1) as ExtractTimestamp;

       ENDIF

       SQL SELECT $(_qvctemp.den.columns) FROM $(_qvctemp.den.table) WHERE $(Qvc.Loader.v.IncrementalExpression) //incrementalExpression is set up the Qvc.IncrementalSetup routine. ;

ENDIF

Labels (1)
1 Solution

Accepted Solutions
NadiaB
Support
Support

Hi @shyamcharan 

Some improvements have been made in newer versions, it seems that the syntax validates what is placed immediately after a tag , please refer to the following documentation:

Table names

So because you have a REM and an IF statements before any data that could be stored into the tabla the error shows,

So the script will work if you place the table alias immediately before a Load statement or a variable

The following scripts will work:

 

SET Qvc.Loader.v.Tablename = 'Test';

set script ='LOAD *, now(1) as ExtractTimestamp';

[$Qvc.Loader.v.Tablename)]:
$(script);

or 

SET Qvc.Loader.v.Tablename = 'Test';

 


IF len('$(_qvctemp.den.loadStatement)')>0 THEN
[$Qvc.Loader.v.Tablename)]:
LOAD * INLINE [
A, B
Q, 345
S, 45654
D, 2345
];

ELSE // No LOAD Statement, build a SQL SELECT
[$Qvc.Loader.v.Tablename)]:
LOAD * INLINE [
A, B
Q, 345
S, 45654
D, 2345
];

ENDIF

Note: if this response helps to resolve the issue, it will be appreciated if you could mark it as Solved.

We encourage you to visit our Knowledge Base https://qliksupport.force.com/QS_CoveoSearch when trying to find a solution related and not limited to: errors, product malfunctioning, feature requests, product defects. You can also visit our Qlik Help portal https://help.qlik.com/

Don't forget to mark as "Solution Accepted" the comment that resolves the question/issue. #ngm

View solution in original post

2 Replies
NadiaB
Support
Support

Hi @shyamcharan 

Some improvements have been made in newer versions, it seems that the syntax validates what is placed immediately after a tag , please refer to the following documentation:

Table names

So because you have a REM and an IF statements before any data that could be stored into the tabla the error shows,

So the script will work if you place the table alias immediately before a Load statement or a variable

The following scripts will work:

 

SET Qvc.Loader.v.Tablename = 'Test';

set script ='LOAD *, now(1) as ExtractTimestamp';

[$Qvc.Loader.v.Tablename)]:
$(script);

or 

SET Qvc.Loader.v.Tablename = 'Test';

 


IF len('$(_qvctemp.den.loadStatement)')>0 THEN
[$Qvc.Loader.v.Tablename)]:
LOAD * INLINE [
A, B
Q, 345
S, 45654
D, 2345
];

ELSE // No LOAD Statement, build a SQL SELECT
[$Qvc.Loader.v.Tablename)]:
LOAD * INLINE [
A, B
Q, 345
S, 45654
D, 2345
];

ENDIF

Note: if this response helps to resolve the issue, it will be appreciated if you could mark it as Solved.

We encourage you to visit our Knowledge Base https://qliksupport.force.com/QS_CoveoSearch when trying to find a solution related and not limited to: errors, product malfunctioning, feature requests, product defects. You can also visit our Qlik Help portal https://help.qlik.com/

Don't forget to mark as "Solution Accepted" the comment that resolves the question/issue. #ngm
Brett_Bleess
Former Employee
Former Employee

Shyam, did Nadia's post help you get things sorted?  If so, please consider using the Accept as Solution button on her post to give her credit for the help.  If you did something else, it would be great if you can post what you did in case someone else runs into the same issue...

Nadia hit on what I expected was going on, generally these issues are not really in QlikView per se, but in the Connector/Driver etc., hopefully Nadia's comments helped you find the root cause and you were able to adjust and get things working.

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.