Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Below is the script we were using but here we are calculating COUNT(APPL#) and we have this value with database it showing wrong but if just load the APP table alone it shows the right value.
Please let me know if the is wrong
APP:
LOAD
date((FCFSDT),'MM/D/YYYY') as SUB_Date,
FCFSDT,
COMP,
FCAACD as Location,
APPL# ,
FCALNB as CustomerID,
[FCK0ST],
pick(match([FCK1ST],'R','W'),'In-store','Offsite Site (Web+Ph+Mail)') as Channel,
pick(match([FCK0ST],'A','C','D','I','Q','U','W'),'Approved','Canceled','Declined','In Store','queued','Used','Waiting') as App_Status,
pick(match([COMP],'CON','GEM'),'Conns Application','GE Application') as App_Category,
Year(Date(AddYears(Date(Date#('19' & Right(FCFSDT,6),'YYYYMMDD'), 'DD/MM/YYYY'), 100 * Left(FCFSDT,1)), 'M/D/YYYY')) as Year
Date(AddYears(Date(Date#('19'&Right(FCFSDT,6),'YYYYMMDD'),'MM/DD/YYYY'),100*Left(FCFSDT,1)),'M/D/YYYY') as App_Date
;
SQL SELECT *
FROM AS400D75.STOPRE.GRETYYUwhere FCFSDT>='1140101';
left join (APP)
Loc:
LOAD //ADABCD as CompanyCode,
ADAACD as Location,
ADAUNB as Address,
ADASTX as LocationDesc,
//ADAGST as LocationType,
//ADBEST as SubLocaInd,
ADACCD as District
;
SQL SELECT *
FROM AS400D60.DISPDBF.DSADREP;
left join (APP)
Con:
LOAD ACA1CD as Country,
// ACANTX as Address1,
// ACAOTX as address2,
ACAPTX as Zipcode,
ACAUNB as Address
;
SQL SELECT *
FROM AS400D70.HEDFGS.POIUJC;
left join (APP)
State:
LOAD AEADST as State,
AEAPTX as Zipcode,
AEAQTX as City,
AEARTX as County;
SQL SELECT *
FROM AS400D60.YRDGSF.LKJHGBV;
RACAPPLI:
LOAD APPL# as racApplicationNbr,
[COMP] as raccomp,
App_Category as racAppCategory,
Location as racLocation,
CustomerID as racCustomerID,
FCFSDT as racFCFSDT,
App_Status as racAppStatus,
Channel as racChannel,
// Month as racMonth,
LocationDesc as rsalocdes,
App_Date as racApp_Date,
State as RACState,
Zipcode as RACZipCode,
City as RACCity
RESIDENT APP
WHERE App_Status='Declined'and App_Category='Conns Application' ;
inner join (RACAPPLI)
RACCust:
LOAD
C4OZXT ,
C4OVXT,
Left((C4OZXT), Len(C4OZXT)-8) as racCustomerID
;
SQL SELECT *
FROM AS400D60.IKUJYHTG.CAC4CPP;
left join(APP)
LOAD LOCATION as Location,
Market
FROM
(ooxml, embedded labels, table is Sheet1);
left join( RACAPPLI)
LOAD LOCATION as racLocation,
Market as racmarket
FROM
(ooxml, embedded labels, table is Sheet1);
SSS:
left join(APP)
LOAD Location,
SSS_Indicator
FROM
(qvd);
SSS:
left join(RACAPPLI)
LOAD Location as racLocation ,
SSS_Indicator as racSSS_Indicator
FROM
(qvd);
Thanks..
Cool,
But add distinct on the load script of your previous join table to don't load useless data.
As it is a long script. check your data model and see what is the issue. it would be easier to identify .
1. Are the keys joined appropriate
2. Check for synthetic keys
3. try to use concatenate and drop fields which are iterated.
Hi,
As you said we have used the Distinct in the joining table but still it gives wrong count.
APP:
LOAD
FCFSDT,
COMP,
FCAACD as Location,
APPL# ,
FCALNB as CustomerID,
[FCK0ST],
;
SQL SELECT *
FROM AS400D60.OIUYTFD.RTYUFGHI where FCFSDT>='1140101';
left join (APP)
Loc:
LOAD Distinct
ADAACD as Location,
ADAUNB as Address,
ADASTX as LocationDesc,
ADACCD as District
;
SQL SELECT *
FROM AS400D60.IUJHYGTFD.SDFGHJ;
Thanks..
Can you try just with Join and try ..no Left join
That signify that for one Location id you have different attribute. For example :
Location Address LocationDesc District
049 Central Road 1 Home 22
049 Middle Road 3 Work 22
If it's not normal, you have bad quality data and you need to clean them.
If its normal, load your table without the join.
Hi,
Will check and let you know.
Thanks,
Sebatien