I am having a datatable with 470 columns and 69 rows
the each column name is a code and first column contains the filteration key to filter with the other datatable which is having the result of these keys.
Here starting from 22657 ,35975 , etc are the codes and vertically first column (RSF 1Ltr,RSF500ml) are the keys to filter the another datatable.
One code is having 69 rows to be filtered with the below dt
here the code must be filtered with column customer code and SKU column must be filtered with the SKU column of master dt like RSF 1ltr etc… and with the filtered DT the billed quantity column must be added up and the value must be updated in master dt corresponding to the code and SKU key.
Please help me with linq query to do this by using UiPath for each loop activities it will take huge time.
lets keep in mind that value update in LINQ can lead to blackboxing and/or DataTable Reconstruction. In some cases it is fine in other cases we prefer to avoid. A good strategy is also the combination of hybride (Linq, Non-Linq) approaches.
processing costs are more to focus and we we will not mandatory exclude for each for column updates
So we would suggest the following strategy:
prepare a lookup dictionary / Datatable on the table (which is to filter and to sumup) by grouping the data on SKU and CustomerCode and sum up the Billed Quantitiy
Then loop over the MasterDt all Rows
nested loop over all codes (the Datacolumn names will be used)
use First Col, Code Colname for the look up and update the value with the returned value from the lookup