Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
upaliwije
Creator II
Creator II

Error in Script

sales:

LOAD [POLICY_NO],

     CLA_CODE ,

     PRD_CODE ,

     if (CLA_CODE='MC','MOTOR',if(CLA_CODE='M3','MOTOR',if(CLA_CODE='M4','MOTOR','NON_MOTOR')))as MONM,

     POL_PERIOD_FROM,

     POL_PERIOD_TO,

     POL_SUM_INSURED,

     ME_CODE,

     BCOD,

     TRN_TYPE,

     POL_TYPE,

      //if (POL_TYPE='N', 'NEW',if(POL_TYPE='R','REN',if(POL_TYPE='A','ADD',if(POL_TYPE='F','REF'))))as BUS_TYPE,

     if (POL_TYPE='N', 1,if(POL_TYPE='R',1,if(POL_TYPE='F'and POL_STATUS='9',-1)))as Nos,

     REF_NO,

     RC_TRN_TYPE,

     T_DATE , //tranaction date

     TRN_DATE AS  RISK_DATE,

      PREMIUM,

     CC_CODE

    

FROM

E:\Qlikview\QVD\FACT_Table\Sales.qvd

(qvd)

WHERE  year( T_DATE)>=2011  and BCOD='KU00' ;

Inner Join

Claims:

LOAD [POLICY_NO],

     CLAIM_NO,

     BCOD,

     CRE_ACC_PAID_BRANCH,

     PAID_DATE ,

     ME_CODE,

    LOSS_DATE,

     CRE_PAID_AMOUNT ,

     CRE_CEN_PRS_NAME,

     CRE_CAUSE_LOSS,

    CLA_CODE,

     if (CLA_CODE='MC','MOTOR',if(CLA_CODE='M3','MOTOR',if(CLA_CODE='M4','MOTOR','NON_MOTOR')))as MONM,

     PRD_CODE

FROM

[..\QVD\FACT_Table\Claims.qvd]

(qvd) where  BCOD='KU00' ;

FACT:

NoConcatenate

LOAD * Resident sales

where  LOSS_DATE >=[POL_PERIOD_FROM] and  LOSS_DATE <=[POL_PERIOD_TO];

DROP TABLE sales;

Concatenate

LOAD [POLICY_NO], PREMIUM 

from

E:\Qlikview\QVD\FACT_Table\Sales.qvd

where not Exists([POLICY_NO]);

Dear Friends

When run the above script in my data model I get the error message as given in the attachment. Pls let me know where I have made the mistake in my script.

1 Solution

Accepted Solutions
maxgro
MVP
MVP

you have to add

(qvd)

to the last file you read as you did for other qvd files in your script

Concatenate

LOAD [POLICY_NO], PREMIUM

from

E:\Qlikview\QVD\FACT_Table\Sales.qvd (qvd)

where not Exists([POLICY_NO]);

View solution in original post

6 Replies
sundarakumar
Specialist II
Specialist II

Try moving

Drop table sales;

to the end of the script.

-Sundar

maxgro
MVP
MVP

you have to add

(qvd)

to the last file you read as you did for other qvd files in your script

Concatenate

LOAD [POLICY_NO], PREMIUM

from

E:\Qlikview\QVD\FACT_Table\Sales.qvd (qvd)

where not Exists([POLICY_NO]);

Not applicable

can u upload dummy data sample

Not applicable

FACT:

NoConcatenate

LOAD * Resident sales

where  LOSS_DATE >=[POL_PERIOD_FROM] and  LOSS_DATE <=[POL_PERIOD_TO];

DROP TABLE sales;

Concatenate

LOAD [POLICY_NO], PREMIUM

from

E:\Qlikview\QVD\FACT_Table\Sales.qvd(qvd)

where not Exists([POLICY_NO]);

upaliwije
Creator II
Creator II
Author

Thanks

It is working

marchoctober
Creator
Creator

Usually, 90% of script errors are related to syntax, mostly missed ; somewhere, recently other syntax issues.