Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
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]);
Try moving
Drop table sales;
to the end of the script.
-Sundar
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]);
can u upload dummy data sample
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]);
Thanks
It is working
Usually, 90% of script errors are related to syntax, mostly missed ; somewhere, recently other syntax issues.