Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 3

Set dataManagerTables =

'','financiar$','cheltuielisalariale$','angajati$','(REGIUNI...)','REGIUNI','Catego
rie_Companie';
//This block renames script tables from non generated section which conflict with
the names of managed tables

For each name in $(dataManagerTables)


Let index = 0;
Let currentName = name;
Let tableNumber = TableNumber(name);
Let matches = 0;
Do while not IsNull(tableNumber) or (index > 0 and matches > 0)
index = index + 1;
currentName = name & '-' & index;
tableNumber = TableNumber(currentName)
matches = Match('$(currentName)', $(dataManagerTables));
Loop
If index > 0 then
Rename Table '$(name)' to '$(currentName)';
EndIf;
Next;
Set dataManagerTables = ;

Unqualify *;

[Financiar]:
LOAD
AutoNumber(AN&Regiune_ID&Categorie_ID&Companie_ID) as TableKey,
[NETPROFIT],
[OP_PROFIT],
[OP_VENITURI],
[OP_CHELTUIELI],
[Companie_ID],
[Denumire],
[Categorie_ID],
[AN],
[TRIMESTRU],
[Regiune_ID]
FROM [lib://DataFiles/financiar.xls]
(biff, embedded labels, table is financiar$);

JOIN
LOAD
AutoNumber(AN&Regiune_ID&Categorie_ID&Companie_ID) as TableKey,
[SAL_MGT],
[SAL_FLIGHT],
[SAL_MAINT],
[SAL_TRAFFIC],
[SAL_OTHER],
[TOTALSALARII],
[BENEFICII_PERS],
[PENSII],
[BENEFITS_PAYROLL],
[TOTALBENEFICII],
[CHELTUIELI_SAL],
[Categorie_ID],
[Companie_ID],
[Denumire] ,
[AN] ,
[TRIMESTRU],
[Regiune_ID]
FROM [lib://DataFiles/cheltuieli salariale.xls]
(biff, embedded labels, table is cheltuielisalariale$);

[Angajati]:
LOAD
AutoNumber(AN&Regiune_ID&Categorie_ID&Companie_ID) as TableKey,
[AN],
[Companie_ID],
[Denumire],
[Categorie_ID],
[Regiune_ID] ,
[MGT],
[FLIGHT],
[PILOTS_COPILOTS],
[OTHER_FLT_PERS],
[PASS_GEN_SVC_ADMIN],
[MAINTENANCE],
[ARCFT_TRAF_HANDLING_GRP1],
[GEN_ARCFT_TRAF_HANDLING],
[AIRCRAFT_CONTROL],
[PASSENGER_HANDLING],
[CARGO_HANDLING],
[TRAINEES_INTRUCTOR],
[STATISTICAL],
[TRAFFIC_SOLICITERS],
[OTHER],
[TRANSPORT_RELATED],
[TOTAL]
FROM [lib://DataFiles/angajati-categorii-an.xls]
(biff, embedded labels, table is angajati$);

[Companii]:
load distinct Companie_ID, Denumire as Denumire_Companie Resident Financiar;

[Key]:
load distinct TableKey, AN, Regiune_ID, Categorie_ID, Companie_ID Resident
Financiar;
load distinct TableKey, AN, Regiune_ID, Categorie_ID, Companie_ID Resident
Angajati;

[Regiuni]:
LOAD
[Cod] as [Regiune_ID],
[Descriere] as [Regiune]
FROM [lib://DataFiles/REGIUNI.csv]
(txt, codepage is 28591, embedded labels, delimiter is ',', msq);

[Categorii]:
LOAD
[Cod] as [Categorie_ID],
[Descriere] as [Categorie]
FROM [lib://DataFiles/Categorie_Companie.csv]
(txt, codepage is 28592, embedded labels, delimiter is ',', msq);
drop fields AN, Regiune_ID, Categorie_ID, Companie_ID, Denumire from Financiar;
drop fields AN, Regiune_ID, Categorie_ID, Companie_ID, Denumire from Angajati;

You might also like