RobWunderlich / Qlikview-Components

A library for common Qlikview Scripting tasks
197 stars 99 forks source link

Issue with using Qvc.ImportModel #96

Open AndrewGri opened 1 year ago

AndrewGri commented 1 year ago

Qlik Sense.

An application loads data using Qvc.ImportModel call. Previously model was exported by another ("Transform") application. At the first time data loaded successfully. But starting from the second attempt to execute load script the following error appears: "... The control statement is not correctly matched with its corresponding start statement...".

I found that error disappears after adding the following code after Qvc.ImportModel call:

Set _qvctemp.TableName = ; Set _qvctemp.FieldNames = ;

RobWunderlich commented 1 year ago

Can you post your script please, including the CALL statements?

AndrewGri commented 1 year ago

Sure.

Here it is:


Table:
LOAD
    *
INLINE [
    ProductCode, Cost
    PR1, 100
];

CALL Qvc.ExportModel('lib://QS Models/model');

DROP TABLE Table;

CALL Qvc.ImportModel('lib://QS Models/model/QVC Check.qvd');

CALL Qvc.Cleanup;

For the first time everything is Ok, but starting from the second attempt the error message appears:

image

balexbyrd commented 1 year ago

I can also confirm that I have the exact same issue and when I set the variables prior to including the Qvc.qvs file the issue was resolved.