Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Must_Include unknown statement error

Hi


I am trying to use the $(Must_Include) system variable to load in some common variables from a text file.  When reloading I am getting a script error - Unknown statement ÿþ/


The bizarre thing is the contents of the text file was copied from a working script and after the script error I have copied the contents of the text file back into the script without error...


Can anyone shed any light or suggest a fix?


Other than the generated format variables the script only contains this:

$(Must_Include=Constants.txt);

The file is stored in the same folder as the document.


The Constants.txt contains the following text:

SET HidePrefix    = '%';   
SET ServerPath    = '\\dtqv\qlikview docs\draper\QVD Builders\QVD Files\';   
SET Months   = '*January','*February','*March','*April','*May','*June','*July','*August','*September','*October','*November','*December';   
SET Domain   = 'WIN2003DOMAIN\';   
SET n    = 4;   
SET MiscOrderCodeExclusions   = 910, 913;   
SET CreditTypeExclusions   = 3, 10, 11, 13, 20;   
//     3 = Extra discount on goods retained  
//    10 = Incorrect Price Charged  
//    11 = Incorrect Discount Charged  
//    13 = Carriage charged in error  
//    20 = Lost/Damaged in transit  
SET _Today   = today(1);   
//SET URL    = SEE [SalesData TAB]   
  
LET LF   = chr(10); // Line Feed   
LET SQ   = chr(39); // Single Quote (Apostrophe)   
LET ThisMonth   = num(month($(_Today)),'00');   
LET LastMonth   = num(month(addmonths($(_Today),-1)),'00');   
LET ThisMonthName   = date($(_Today),'MMM');   
LET LastMonthName   = date(addmonths($(_Today),-1),'MMM');   
  
LET ThisDoc   = documentname();   
//LET DocumentPath   = left(replace(documentpath(),'X:\','\\dtqv\qlikview docs\'),index(replace(documentpath(),'X:\','\\dtqv\qlikview docs\'),ThisDoc)-1);   
LET CONCATENATE    = '';   
LET Show   = True();   
LET Hide   = False();   
  
FOR i    = 0 to 3   

    LET YEAR$(i)     = year(now())-$(i);   

NEXT i;  
LET i   = NOTHING;   

Thanks

Oli


Tags (1)
1 Solution

Accepted Solutions
Not applicable

Re: Must_Include unknown statement error

I found the problem.  Corruption in the text file.

Pasting the script into a new text file and overwriting the original fixed it??!! I copied the original text file over to my test...

Thanks

Oli

3 Replies

Re: Must_Include unknown statement error

I would check if the this file -> Constants.txt actually exists at the location. Because if you just copied the script and the file was not transferred you will end up having an error.

Not applicable

Re: Must_Include unknown statement error

Hi Sunny

Yeah it definitely exists.  I created the qvw and txt file as a test document having come across this error in another document, so I stripped it down to the basics to try and figure it out.

Oli

Not applicable

Re: Must_Include unknown statement error

I found the problem.  Corruption in the text file.

Pasting the script into a new text file and overwriting the original fixed it??!! I copied the original text file over to my test...

Thanks

Oli

Community Browser