Sie sind auf Seite 1von 160

All transformations

source qualifier

sorter transformation

sequence generator

Router trans

Rank trans

normalizer trans

in normalizer trans we can create fields it will take automatically input rows and output rows

joiner trans

filter trans

expression

aggregator trans

lookup connected

stored procedure......
first we have create procedure....
SQL> create or replace procedure tsalary(sal in emp.sal%type,deptno in emp.dept%type,tsal out number)
2 is
3 begin
4 tsal:=sal+deptno;
5 end;
6 /
Procedure created.

creating a cube.....
first we have to go target.....then....click the create/edit dimension

2.then click the add dimension

give the name and click the ok

like we can create two dimensions.........


then select the levels........add level

for the level give one name (name is level1)

then click the import source button

then select the table

select the all fields then click ok button

then add th hirarchy

for the hierarchy u can give one name(name is h1) then u can select the non-normalized then click apply finish

same process for another table also........


then two dimension table finish then

we can drag levels into the hierarchies.....

for two levels like that only ........then click ok button


then close it

now we can create cube.....

enter the name....and select the non-normalization

select the both tables.....then click next button

then select the fields (primary keys and measurable data) then click the next button

then we can see the one window(there if we want we can insert the new fields) click the finish

we can get the window is like

then click the close cube.....

then select and drag the two dimension table and fact table into the warehouse designer then generate the tables.....

then select the mapping designer......


first we have create the first dimension mapping......

second dimension mappingg.....

for the cube mapping....we need two lookup transformations then save it finish....the cube

loan system project


Loan System:
-------------------The project is for a Finance Company involved in disbursal of loan amounts for various purposes like: Personal Loan,
Vehicle Loan, Housing Loan, Consumer Durable Loans, etc. The company requires different level of analysis regarding
loan amount, type of customers, type of payment schedules, interest rates (variable or fixed), defaulters list and the penal
interest calculations, etc. The datawarehouse (basically it is a Data Mart as it covers only one domain of the business)
captures data from their Transactional Database maintained under Cleint/Server Architecture. The main cube for the
anlysis consist of following Measures and Dimensions:
- Loan Amount (Measure)
- Interest Amount (Measure)

- Unrecovered Amount (Measures)


- Discount Amount on Prepayment (Measures)
- Period (Dimension)
- Customer (Dimension)
- Loan Type (Dimension)
- Vehicle Type (Dimension)
- Products (Dimension)
- Area (Dimension)
- City (Dimension)
- Cast (Dimension)
- Income Group (Dimension)
- Profession (Dimension)
Using the above measures and dimension four cubes are generated and and most of dimensions participate in all the four
cubes. For Reporting we used Business object sand for Data Transformation and Loading Informatica PowerCenter 6.2.1
Product (Designer, Workflow Manager & monitor) is used.
Tables:
Housing Loan Module
------------------------------Table Name: Loan_Scheme_Master
Loan_Scheme_ID
NUMBER
-- PK
Loan_Scheme_Name
VARCHAR2(30)
Min_Age
NUMBER(2)
Max_Age
NUMBER(2)
Min_Loan_Amount
NUMBER(10,2)
Max_Loan_Amount
NUMBER(10,2)
Loan_Margin
NUMBER(4,2)
Min_Holiday_Period
NUMBER(3) -- In months
Max_Holiday_Period
NUMBER(3) -- In months
Min_Repay_Period
NUMBER(3) -- In years
Max_Repay_Period
NUMBER(3) -- In years
Gestation_Period
NUMBER(3) -- In months
Place_Of_Sanction
VARCHAR2(2000)
Penal_Interest
NUMBER(4,2)
-- In percentage
Penal_Interest_Desc
VARCHAR2(2000)
___________________________________________________________________
Table Name: Interest_Master
Loan_Scheme_ID
Interest_Rate
Effective_From

NUMBER
NUMBER(4,2)
DATE

-- FK

Effective_Upto

DATE

Table Name: Borrower_Eligibility_Master


Loan_Scheme_ID
NUMBER
- FK (from Loan_Scheme table)
Eligibility_SrNo
NUMBER(2)
Eligibility_Desc
VARCHAR2(30)
________________________________________________________________
Table Name: Entity_Eligibility_Master
Loan_Scheme_ID
NUMBER
- FK (from Loan_Scheme table)
Entity_SrNo
NUMBER(2)
Entity_Desc
VARCHAR2(30)
___________________________________________________________________
Table Name: Collateral_Security_Master
Loan_Scheme_ID
NUMBER
-- FK (from Loan_Scheme table)
Amount_Range_Low
NUMBER(10,2)
Amount_Range_High
NUMBER(10,2)
Collateral_Details
VARCHAR2(2000)
===================================================================================
Table Name: Borrower_Master
Borrower_ID
NUMBER
-- PK
Borrower_Name
VARCHAR2(50)
Borrower_Type_ID
NUMBER -- FK (from Borrower_Type_Master table)
Borrower_Premises_No
VARCHAR2(15)
Borrower_Premises_Name
VARCHAR2(50)
Borrower_Area_Name
VARCHAR2(25)
Borrower_City_Name
VARCHAR2(25)
Borrower_State_Name
VARCHAR2(25)
Borrower_PIN
VARCHAR2(6)
Borrower_Phone
VARCHAR2(20)
Borrower_Fax
VARCHAR2(20)
Borrower_Email_ID
VARCHAR2(50)
Borrower_URL
VARCHAR2(50)
Borrower_PAN
VARCHAR2(15)
Borrower_Status_ID
NUMBER
-- FK (from Borrower_Status_Master table)
=================+++++++++++++++++++++++++++++===============================
Table Name: Borrower_Type_Master
Borrower_Type_ID
NUMBER
-- PK
Borrower_Type_Name
VARCHAR2(30)
Borrower_Type_Desc
VARCHAR2(50)
=============-----------------------------------------------------------======================---------------------Table Name: Borrower_Status_Master
Borrower_Status_ID

NUMBER

-- PK

Borrower_Status_Desc
VARCHAR2(30)
Borrower_Status_Action
VARCHAR2(200)
==================================================================================
Table Name: Loan_Master
Loan_ID
NUMBER
-- PK
Loan_Scheme_ID
NUMBER
-- FK (from Loan_Scheme_Master table)
Borrower_ID NUMBER
-- FK (from Borrower_Master table)
Loan_Sanction_Date
DATE
Loan_Sanction_Amount
NUMBER(10,2)
Loan_Sanctioned_By
NUMBER
-- FK (from Employee_Master table)
Loan_Duration
NUMBER
-- In months
Installment_Type
VARCHAR2(10)
-- Monthly, Quarterly, Half Yearly, Yearly
Installment_Amount
NUMBER(10,2)
Installment_Grace_Period
NUMBER(3) -- In days
Installment_Penalty_Rate
NUMBER(4,2)
=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=============-=-=-=-=========================-=Table Name: Loan_Installment_Master
Loan_ID
NUMBER
-- FK(Loan_ master)
Installment_No
NUMBER(3)
Installment_Due_Date
DATE
Installment_Amount
NUMBER(10,2)
Installment_Status
VARCHAR2(15)
-- Due, Paid, Due But Unpaid
-------------------------------------------------------------------------------------------------------------------------------------------Table Name: Loan_Repayment
Loan_ID
NUMBER
-- FK
Receipt_ID
VARCHAR2(25)
Receipt_Date
DATE
Amount_Received
NUMBER(10,2)
Received_By
NUMBER
-- FK (from Employee Master table)
Paid_By
VARCHACR2(25)
================================================================================
Table Name: Employee_Master
Employee_ID
Employee_Name
Employee_Designation
Department_ID

NUMBER
-- PK
VARCHAR2(30)
VARCHAR2(30)
NUMBER
-- FK (from Department_Master table)

---------------------------------------------------------------========================---------------------------------------------Table Name: Department_Master


Department_ID
NUMBER
-- PK
Department_Name
VARCHAR2(30)

For the table values


insert into LOAN_SCHEME_MASTER values(01,'Housing loan',5,20,100000,500000,0.25,10,18,5,20,12,
'Chn',2,'For loans above Rs.2lacs penal interest at 2% be charged on overdue amount for overdue period');
insert into LOAN_SCHEME_MASTER values(02,'Education loan',12,30,100000,750000,0.05,6,12,5,7,36,
'Chn',2,'For loans above Rs.2lacs penal interest at 2% be charged on overdue amount for overdue period');
insert into LOAN_SCHEME_MASTER values(03,'Personal loan',21,58,50000,200000,0.25,0,0,1,5,0,
'Chn',2,'For loans above Rs.2lacs penal interest at 2% be charged on overdue amount for overdue period');
insert into LOAN_SCHEME_MASTER values(04,'Consumer loan',21,100,50000,500000,0.25,0,0,1,5,0,
'Chn',2,'For loans above Rs.2lacs penal interest at 2% be charged on overdue amount for overdue period');
insert into LOAN_SCHEME_MASTER values(05,'Automobile loan',18,60,25000,2500000,0.20,0,0,3,5,0,
'Chn',2,'For loans above Rs.2lacs penal interest at 2% be charged on overdue amount for overdue period');
insert into LOAN_SCHEME_MASTER values(06,'Contingency loan',18,60,20000,500000,0.25,0,0,3,5,0,
'Chn',2,'For loans above Rs.2lacs penal interest at 2% be charged on overdue amount for overdue period');

insert into interest_master values(01,'12-jan-98','15-feb-07',0.02);


insert into interest_master values(02,'02-jun-03','09-july-08',0.02);
insert into interest_master values(03,'23-aug-00','12-jan-06',0.02);
insert into interest_master values(02,'02-jun-02','09-july-10',0.02);
insert into interest_master values(04,'11-feb-02','15-oct-05',0.02);
insert into interest_master values(05,'10-nov-03','05-feb-11',0.02);
insert into interest_master values(06,'16-july-03','08-feb-08',0.02);

insert into
insert into
insert into
insert into
insert into
insert into

Borrower_Eligibility_Master values(0100001,'36times month income or 3times annual income',01);


Borrower_Eligibility_Master values(0100002,'An Indian National Or secured admission to courses',02);
Borrower_Eligibility_Master values(0100003,'Employees , professional and self-employed',03);
Borrower_Eligibility_Master values(0100004,'Employes,Pensioners,others annual income 30000/-',04);
Borrower_Eligibility_Master values(0100005,'gross annual income 4-2-wheelers 100000, 40000',05);
Borrower_Eligibility_Master values(0100006,'Employees and Pensioners',06);

insert into Entity_Eligibility_Master values(700,'Acount must bestanderd Asset',01);

insert into Entity_Eligibility_Master values(701,'Graduate,PG,Profess- cources',02);


insert into Entity_Eligibility_Master values(702,'Pledge of NSCsKVPsPSUBonds',03);
insert into Entity_Eligibility_Master values(703,'Hypothe of duble to be purchs',04);
insert into Entity_Eligibility_Master values(704,'Vehicle to be purchased',05);
insert into Entity_Eligibility_Master values(705,'------------------',06);
insert into Collateral_Security_Master values(500000,1000000,'Upto Rs 10 lacs no coobligation',01);
insert into Collateral_Security_Master values(400000,1500000,'Upto Rs 4 lacs nil Above 4lacs:Collateral security of
suitable value Or Coobligation of parents,guardians,third party',02);
insert into Collateral_Security_Master values(80000,100000,'Security Documents or legal records require ',03);
insert into Collateral_Security_Master values(90000,2000000,'Security Documents or legal records require',04);
insert into Collateral_Security_Master values(70000,3000000,'Security Documents or legal records will be hand over
After purchase ',05);
insert into Collateral_Security_Master values(50000,100000,'Security Documents or legal records require',06);

insert into Borrower_Master values(1001,'anilkumar','flat no:450','Aparna Apartment','jamalia','chn',


'tamilnadu','500016','55633775','044-55633775','anil_borru@yahoo.com','-----','67542379',10000001,4001);
insert into Borrower_Master values(1002,'anand',0002'flat no:250','Annapurna Apartment','Ayanavaram','chn',
'tamilnadu','500016','55375652','044-55375652','anand@rediffmail.com','-----','42379643',10000002,4002);
insert into Borrower_Master values(1003,'prakash','flat no:450','Gocul Apartment','valacherry','chn',
'tamilnadu','500017','55087341','044-55087341','prakash@yahoo.com','-----','00992379',10000003,4003);
insert into Borrower_Master values(1004,'jai','flat no:653','Swarna Block','ayanavaram','chn',
'tamilnadu','500072','55634444','044-55634444','jai@hotmail.com','-----','67597421',10000004,4004);
insert into Borrower_Master values(1005,'Madeena','flat no:279','Poorna Gardens','jamalia','chn',
'tamilnadu','500032','55512231','044-55512231','madeena@yahoo.com','-----','98329675',10000005,4005);
insert into Borrower_Master values(1006,'John','flat no:870','Green
Park','adyar','chn','tamilnadu','500012','55745754','04455745754','God_heaven@yahoo.com','-----','97923379',10000006,4006);
insert into Borrower_Master values(1007,'krishna','flat no:120','Suraj Apartment','annanagar','chn',
'tamilnadu','500064','55860901','044-55860901','krish@rediff.com','-----','239254237',10000007,4007);

insert into Borrower_Type_Master values(4001,'Employee','Employee drawing salary from branch');


insert into Borrower_Type_Master values(4002,'Student','Completed his intermediate Just');
insert into Borrower_Type_Master values(4003,'SM owner','Doing consumer Business');
insert into Borrower_Type_Master values(4004,'student','she has completed her Degree');
insert into Borrower_Type_Master values(4005,'Employee','Doing job in the private company');
insert into Borrower_Type_Master values(4006,'UnEmployee','But he has Assets-Lands');
insert into Borrower_Type_Master values(4007,'IT profess',' Doing job in the IT company');

insert into
insert into
insert into
insert into
insert into
insert into
insert into

Borrower_Status_Master values(10000001,'salary drawing-10000','Housing Loan');


Borrower_Status_Master values(10000002,'to studyfurther','Study loan');
Borrower_Status_Master values(10000003,'Maitaining his own business','Personal');
Borrower_Status_Master values(10000004,'waiting Higher education loan ','Study Loan');
Borrower_Status_Master values(10000005,'salary-15000Jr Executive','Consumer');
Borrower_Status_Master values(10000006,'Maitening his properties','Automobile ');
Borrower_Status_Master values(10000007,'salary drawing-25000','Consistency');

insert into LOAN_MASTER values(0071,1001,'12-feb-97',01,800000,1111,120,'Quarterly',


20400,120,.02,1122);
insert into LOAN_MASTER values(0072,1002,'02-jun-00',02,500000,1112,96,'Monthly',
5385.33,140,.02,1123);
insert into LOAN_MASTER values(0073,1003,'23-aug-00',03,500000,1114,72,'Monthly',
6944.44,70,.02,1124);
insert into LOAN_MASTER values(0074,1004,'12-feb-00',04,600000,1111,96,'Monthly',
6388.88,140,.02,1176);
insert into LOAN_MASTER values(0075,1005,'12-feb-02',05,100000,1114,36,'Halfyearly',
19125,80,.02,1119);
insert into LOAN_MASTER values(0076,1006,'11-feb-03',06,400000,1111,96,'yearly',
51000,70,.02,1131);
insert into LOAN_MASTER values(0077,1007,'12-july-03',07,80000,1112,60,'Monthly',
1360,30,.02,5661);

insert into Loan_Installment_Master values(0071,55551,'12-oct-03',20400,'24Instals(C)');


insert into Loan_Installment_Master values(0072,55552,'02-sep-03',5385.33,'2Instals(C)');
insert into Loan_Installment_Master values(0073,55553,'23-aug-03',6944.44,'36Instals(C)');
insert into Loan_Installment_Master values(0074,55554,'12-sep-03',6388.88,'18Instals(C)');
insert into Loan_Installment_Master values(0075,55555,'12-feb-04',19125,'3Instals(C)');
insert into Loan_Installment_Master values(0076,55556,'12-oct-04',51000,'0Instals(C)');
insert into Loan_Installment_Master values(0077,55557,'12-aug-03',1360,'1instals(C)');

insert into Loan_Repayment values(20400,'12-july-03',0071,0000,1111,1111,'anil');


insert into Loan_Repayment values(5385.33,'02-aug-03',0072,0000,1112,1112,'Madhu');
insert into Loan_Repayment values(6944.44,'23-july-03',0073,0000,1114,1114,'Balu');
insert into Loan_Repayment values(6388.88,'12-aug-03',0074,0000,1111,1111,'anil');
insert into Loan_Repayment values(19125,'12-sep-03',0075,0000,1114,1114,'Balu');
insert into Loan_Repayment values(51000,'12-oct-03',0076,0000,1111,1111,'anil');
insert into Loan_Repayment values(1360,'12-oct-03',0077,0000,1111,1111,'anil');

insert into Employee_Master values(1111,'personal Officer','anil',88801);


insert into Employee_Master values(1112,'Maneger','Madhu',88802);
insert into Employee_Master values(1113,'probitionary Officer','suresh',88803);
insert into Employee_Master values(1114,'Asst Manager','Balu',8880);
insert into Employee_Master values(1115,'officer','kamal',88804);
insert into Employee_Master values(1116,'probitionary Officer','kiran',88803);
insert into Employee_Master values(1117,'Officer','vignesh',88804);

insert into Department_Master values(88801,'--------------');


insert into Department_Master values(88802,'--------------');
insert into Department_Master values(88803,'---------------');
insert into Department_Master values(88804,'---------------');
insert into Department_Master values(88805,'----------------');
insert into Department_Master values(88806,'-----------------');
insert into Department_Master values(88807,'------------------');

procedures &functions:
1.
create function compInstall8( ploanid in number,pinstalduedate in
IS
CURSOR C1 IS
select loan_id,Installment_Due_Date,Installment_Stat
loan_id=ploanid;
V1 C1%ROWTYPE;
BEGIN
OPEN C1;
FETCH C1 INTO V1;
IF C1%FOUND=FALSE THEN
RETURN(1);
ELSE
IF V1.Loan_ID=ploanid AND
V1.Installment_Due_Date=pinstalduedate AND
V1.Installment_Status=pinstalstatus
THEN
RETURN(2);
ELSE
RETURN(3);
END IF;
END IF;
CLOSE C1;
end compInstall8;

2.
create function compInstall7( ploanid in number,pinstalduedate in date,pinstalstatus in char) return number
IS
CURSOR C1 IS
select loan_id,Installment_Due_Date,Installment_Status from Loan_Installment_Master where
loan_id=ploanid;
V1 C1%ROWTYPE;
BEGIN
OPEN C1;
FETCH C1 INTO V1;
IF C1%FOUND=FALSE THEN
RETURN(1);
ELSE
IF V1.Loan_ID=ploanid AND
V1.Installment_Due_Date=pinstalduedate AND
V1.Installment_Status=pinstalstatus
THEN
RETURN(2);
ELSE
RETURN(3);
END IF;
END IF;
CLOSE C1;
end compInstall7;

Reports:

===================================================================================

=====================================================================================

===================================================================================

=================================================================================

==================================================================================

===================================================================================

====================================================================================

==============================================================================

==============================================================================

===========================================================================

=================================================================================

==================================================================================

Das könnte Ihnen auch gefallen