Hello everyone,
Once again I need some help;
I have an excel file like this:
As you can see, there are different Company ID's, but some Company Id's share the same System and System Output; I need to create Groups named as in the System Column, but I don't want to create repeated Groups, so I just need to create 5 Groups, and then create subGroups into the Groups, taking the subgroup name from the Output System column without repeating them; AND FINALLY CREATE THE OBJECTS TAKING THE NAME FROM "Company ID" column, these objects must be into every Group (Depending on the System that every Company ID has).... PLEASE HELP!!!!! Im using a for loop, but several groups with the same name are created.... help!
Company ID | System | Output System |
ZPR - 001 | TR- Transport Sys | ERP OCP - 6.00 - 4 - 10 |
ZPR - 002 | LOG - Logistics | ERP OCP - 6.00 - 4 - 10 |
ZPR - 003 | TR- Transport Sys | ERP OCP - 6.00 - 4 - 10 |
ZPR - 004 | TR- Transport Sys | ERP OCP - 6.00 - 4 - 10 |
ZPR - 005 | ERP OCP - 6.00 - 4 - 10 | TR- Transport Sys |
ZPR - 006 | ERP OCP - 6.00 - 4 - 10 | PRO - Production Sys |
ZPR - 007 | ERP OCP - 6.00 - 4 - 10 | PRO - Production Sys |
CRC - 020 | ERP OCP - 6.00 - 4 - 10 | SS - Sales Sys |
CRC - 021 | SS - Sales Sys | ERP OCP - 6.00 - 4 - 10 |
CRC - 022 | ERP OCP - 6.00 - 4 - 10 | SS - Sales Sys |
CRC - 023 | ERP OCP - 6.00 - 4 - 10 | PRO - Production Sys |
CRC - 024 | PRO - Production Sys | ERP OCP - 6.00 - 4 - 10 |
SRS - 200 | LOG - Logistics | ERP OCP - 6.00 - 4 - 10 |
SRS - 201 | LOG - Logistics | ERP OCP - 6.00 - 4 - 10 |
SRS - 202 | LOG - Logistics | ERP OCP - 6.00 - 4 - 10 |
SRS - 203 | LOG - Logistics | ERP OCP - 6.00 - 4 - 10 |
SRS - 204 | TR- Transport Sys | ERP OCP - 6.00 - 4 - 10 |
SRS - 205 | SS - Sales Sys | ERP OCP - 6.00 - 4 - 10 |
SRS - 206 | PRO - Production Sys | ERP OCP - 6.00 - 4 - 10 |
I'm using a For loop to iterate through the excel file and get the values of each row, this is mi code:
for(var i = l_docsheets[0].getFirstRowNum() + 1; i <= l_docsheets[0].getLastFilledRowNum(); i++){
var l_companyID = String(l_docsheets[0].cell(i,0).getCellValue());
var l_System= String(l_docsheets[0].cell(i,1).getCellValue());
var l_Out_System= String(l_docsheets[0].cell(i,2).getCellValue());
//Here I'm supposed to create the groups and subgroups and objects, but I'm not really sure hoe to do it, I've tried with IF statement, but the groups still creating repeatedly...
}