Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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:
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/
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:
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/
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