Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- FOR i = 0 to NoOfRows('tables')-1
- LET sheetName = purgeChar(purgeChar(peek('TABLE_NAME', i, 'tables'), chr(39)), chr(36));
- LET file_path = purgeChar(purgeChar(peek('TABLE_CAT', i, 'tables'), chr(39)), chr(36));
- IF sheetName='Sheet1' THEN
- Employees:
- LOAD Distinct //Added distinct since the belgium dummy data is not unique, it is made from the training data
- '1' AS IND_EMPLOYEE_DATA,
- ====> [Pers.nr.] AS EMPLOYEE_ID,
- // ID is required for export functionality
- [Pers.nr.] AS ID,
- [Practice] AS PRACTICE_CODE,
- //[EG],
- [Aanspreeknaam] AS EMPLOYEE_NAME,
- [Emailadres]
- FROM $(file_path) (ooxml, embedded labels, table is [$(sheetName)]) where IsNum([Pers.nr.]) AND [EG] = 'CSS-P' AND
- match([Practice],'B50','B60','B61','B63','B65') > 0; //Added the BE Gxx practices
- // FROM $(file_path) (ooxml, embedded labels, table is [$(sheetName)]) where IsNum([Pers.nr.]) AND [EG] = 'CSS-P' AND
- // match([Practice],'B50','B60','B61','B63','B65') > 0; //Added the BE Gxx practices
- ENDIF
- NEXT
- DROP Table tables;
- //////////////////////////////////////////////
- //2. Load the source data for Financial KPIs//
- //////////////////////////////////////////////
- LET vDir = '$(vPathF)' & '*.xlsx';
- //Find files in path and loop over the files and append data to the tables table
- FOR Each file in FileList(vDir)
- ODBC CONNECT32 TO [Excel Files;DBQ=$(file)];
- tables: //make table tables from the DB info created by the ODBC connection
- SQLtables;
- DISCONNECT; // Don't need ODBC connection anymore
- NEXT
- //One of the fields loaded by SQLtables is "TABLE_NAME". This field will contain the sheet names located in the workbooks.
- //TABLE_CAT contains the full path to the file with the filename and extention
- //We will loop through this set of sheet names.
- //////////////////////////////////////////////
- //3. Load the source data for Training data //
- //////////////////////////////////////////////
- Let vDir = '$(vPathCL)' & '*.xlsx';
- FOR Each file in FileList(vDir)
- ODBC CONNECT32 TO [Excel Files;DBQ=$(file)];
- tables:
- SQLtables;
- DISCONNECT;
- NEXT
- FOR i = 0 to NoOfRows('tables')-1
- LET sheetName = purgeChar(purgeChar(peek('TABLE_NAME', i, 'tables'), chr(39)), chr(36));
- LET file_path = purgeChar(purgeChar(peek('TABLE_CAT', i, 'tables'), chr(39)), chr(36));
- IF sheetName='Sheet1' THEN
- Career_Learning:
- LOAD distinct
- [Activity Code] AS TRAINING_CODE,
- [Activity Name] AS TRAINING_NAME,
- [LocalEmpNumber] AS EMPLOYEE_ID,
- [Registration Status] AS TRAINING_REGISTRATION_STATUS,
- Year([Attempt Completion Date]) AS TRAINING_COMPLETION_YEAR,
- Month([Attempt Completion Date]) AS TRAINING_COMPLETION_MONTH,
- MonthStart([Attempt Completion Date]) AS TRAINING_COMPLETION_YYYYMM
- ===> FROM $(file_path) (ooxml, embedded labels, table is [$(sheetName)]) where IsNum([LocalEmpNumber]) and [Registration Status] = 'Completed';
- ENDIF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement