Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

OK LOAD followed by lines of script

I've reloaded a document and received the following script error:

OK

LOAD

Followed by the script that caused the error

Only thing is, there is no error in the script.  The file path is correct, no missing fields in the excel document it's pulling from, etc. 

Has anyone else come across this and know why it may be happening or if there is actually an error at all?

14 Replies
Miguel_Angel_Baeyens

Can you attach a screenshot? Is that error on screen, in the logs? OK LOAD?

Did the script work before? What is that script doing? Is it possible you are loading a field that is not on the source? Can it be that there are two lines with the same field name? Or that the table has been concatenated if it has the same number and name of fields than a previously loaded one?

sunny_talwar

Can you post a screenshot of the error message?

Anonymous
Not applicable
Author

Capture.PNG

Script wasn't created by me but I am thinking this may be an alert that the script isn't best practice due to the large amount of nested if statements.

sunny_talwar

Would you also be able to share the script used here?

Anonymous
Not applicable
Author

I removed the confidential info.  See below:

OK

LOAD

Policy&'-'&Right(Date([Policy Effective Date],'MM/DD/YYYY'),10)                                                                                                                                                as UniqCommissionImportLink,

'CNA'                                                                                                                                                                                                                                                                as        StatementCarrier,

Policy                                                                                                                                                                                                                                                                as CommissionStatementPolicyNumber,

    [Insured Name]                                                                                                                                                                                                                                                as        Name,

    Right(Date([Policy Effective Date],'MM/DD/YYYY'),10)                                                                                                                                                                as        CommissionStatementPolicyEffectiveDate, 

    [Gross Amount]                                                                                                                                                                                                                                                as StatementPremium,

    ([Amount Due CNA]*-1)+[Amount Due Agent]                                                                                                                                                                                        as StatementAgencyCommission,

    if(Left([Statement Date],3)='JAN',Right([Statement Date],4)&'01',                                                                                               

if(Left([Statement Date],3)='FEB',Right([Statement Date],4)&'02',

if(Left([Statement Date],3)='MAR',Right([Statement Date],4)&'03',

if(Left([Statement Date],3)='APR',Right([Statement Date],4)&'04',

if(Left([Statement Date],3)='MAY',Right([Statement Date],4)&'05',

if(Left([Statement Date],3)='JUN',Right([Statement Date],4)&'06',

if(Left([Statement Date],3)='JUL',Right([Statement Date],4)&'07',

if(Left([Statement Date],3)='AUG',Right([Statement Date],4)&'08',

if(Left([Statement Date],3)='SEP',Right([Statement Date],4)&'09',

if(Left([Statement Date],3)='OCT',Right([Statement Date],4)&'10',

if(Left([Statement Date],3)='NOV',Right([Statement Date],4)&'11',

if(Left([Statement Date],3)='DEC',Right([Statement Date],4)&'12','REVIEW'))))))))))))   as MonthPaidbyCarrier,

    if([Agency Name]='XXX','XXX',

if([Agency Name]='XXX','XXX',

if([Agency Name]='XXX','XXX',

if([Agency Name]=''XXX','XXX',

if([Agency Name]=''XXX','XXX','REVIEW')))))                                                                                                                                as CommissionStatementBranch,

RecNo()                                                                                                                                                                                                                                                                as        RecNo

FROM

[\\'XXX','XXX',]

(ooxml, embedded labels, table is Sheet1)

vishsaggi
Champion III
Champion III

Where are commas in your script after each field in Load?

sunny_talwar

You def. are missing a colon

OK:

LOAD

Policy&'-'&Right(Date([Policy Effective Date],'MM/DD/YYYY'),10)  as UniqCommissionImportLink,

'CNA'                                                                                                                                                                                                                                                                as        StatementCarrier,

Policy                                                                                                                                                                                                                                                                as CommissionStatementPolicyNumber,

    [Insured Name]                                                                                                                                                                                                                                                as        Name,

    Right(Date([Policy Effective Date],'MM/DD/YYYY'),10)                                                                                                                                                                as        CommissionStatementPolicyEffectiveDate,

    [Gross Amount]                                                                                                                                                                                                                                                as StatementPremium,

    ([Amount Due CNA]*-1)+[Amount Due Agent]                                                                                                                                                                                        as StatementAgencyCommission,

    if(Left([Statement Date],3)='JAN',Right([Statement Date],4)&'01',                                                                                          

if(Left([Statement Date],3)='FEB',Right([Statement Date],4)&'02',

if(Left([Statement Date],3)='MAR',Right([Statement Date],4)&'03',

if(Left([Statement Date],3)='APR',Right([Statement Date],4)&'04',

if(Left([Statement Date],3)='MAY',Right([Statement Date],4)&'05',

if(Left([Statement Date],3)='JUN',Right([Statement Date],4)&'06',

if(Left([Statement Date],3)='JUL',Right([Statement Date],4)&'07',

if(Left([Statement Date],3)='AUG',Right([Statement Date],4)&'08',

if(Left([Statement Date],3)='SEP',Right([Statement Date],4)&'09',

if(Left([Statement Date],3)='OCT',Right([Statement Date],4)&'10',

if(Left([Statement Date],3)='NOV',Right([Statement Date],4)&'11',

if(Left([Statement Date],3)='DEC',Right([Statement Date],4)&'12','REVIEW'))))))))))))  as MonthPaidbyCarrier,

    if([Agency Name]='XXX','XXX',

if([Agency Name]='XXX','XXX',

if([Agency Name]='XXX','XXX',

if([Agency Name]=''XXX','XXX',

if([Agency Name]=''XXX','XXX','REVIEW')))))                                                                                                                                as CommissionStatementBranch,

RecNo()                                                                                                                                                                                                                                                                as        RecNo

FROM

[\\'XXX','XXX',]

(ooxml, embedded labels, table is Sheet1)

krishna_2644
Specialist III
Specialist III

try running the script without the word OK.

Anonymous
Not applicable
Author

sorry for the confusion.  OK isn't in the script but is in the script error.  It doesn't appear anywhere in the actual script.