Once the Excel in attachment is uploaded in the MSHFlexgrid, I would like to create loads based on 5 columns. Columns identified in below snapshot.
Loads needs to be created based on Origin Country, Destination State, Commodity, Source ID and Dest_ID.
What you will also see is a TextBox that will tell how many Stops should be set Per Loads.
During the load creation, it will take a look at column 1, 2, 3, 4 combination for the first step, then, it will take from DEST_ID (Column no 5 in below snapshot) the first 5 distinct numbers to create a load. In the columns 1, 2, 3, 4 and 5, you can have multiple times the same numbers as they are different orders IDs from column ID.
Once it found the distinct 5 DEST_ID numbers with same values from column 1, 2, 3, 4 combination, it will name the load based on column number 2 and 3 from above snapshot.
If the first 5 distinct numbers from column 5 and column 2 = AB and column 3 = DRY, the first load would be called AB_DRY_1. If I have another 5 distinct DEST_ID with the same values in columns 1, 2, 3, 4, it will name it AB_DRY_2.
It may happen where we may have less than 5 different numbers to create a load. In this case, it will only be 1 load.
In below snapshot, it shows the results it should gave.
The first 4 rows have the same values Source_id: 35, Dest_ID: 04, Origin Country: Canada, Destination_State: AB and Commodity: DRY. In this case, it will build a load with only 1 stop with load ID called: AB_DRY_1.
How can these load IDs be created?
In attachment, you will found a sample of the project and also an excel file that you can use to populate the grid (sheet Data Set) and also an example of the final result on sheet FINAL RESULT.
Thanks for your help.