RobWunderlich / Qlikview-Components

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

QVC include failes if SET Qvc.Global.Extension.Directory is predefined #52

Closed veglar closed 7 years ago

veglar commented 7 years ago

If you have defined Qvc.Global.Extension.Directory and script fails before executing qvc.cleanup then the include of qvc.qvs failes will fail the next time you run the script. I'm using the QVC 10.2 and Qlik Sense 3.0.3.

My test script:

$(must_include=lib://QVC/Qvc_Runtime\Qvc.qvs);
SET Qvc.Global.Extension.Directory=lib://QVC\etc\;
call qvc.calendar(today()-1000, today(), 'Test')
// call qvc.cleanup

image

I've identified the error to be caused within the Qvc.ColorTheme.

$(_qvctemp.colorTable):
LOAD trim(ColorVariable) as _qvctemp.ColorVariable,
     trim(ColorValue) as _qvctemp.ColorValue
FROM
[$(_qvctemp.themeFile)]
(ooxml, embedded labels, table is Sheet1)
WHERE len(trim(ColorVariable))>0 and left(trim(ColorVariable),2) <> '//'
;

If you put brackets around the table name declaration the problem dissapear.

[$(_qvctemp.colorTable)]:
LOAD trim(ColorVariable) as _qvctemp.ColorVariable,
     trim(ColorValue) as _qvctemp.ColorValue
FROM
[$(_qvctemp.themeFile)]
(ooxml, embedded labels, table is Sheet1)
WHERE len(trim(ColorVariable))>0 and left(trim(ColorVariable),2) <> '//'
;