How to look up a value row and apply arithmethic?

I have a table, on which I need to review each row item into different columns.
For example, I have first value row and I have to look for if the “ship to”, “company part number” and “UOM” matches with my conversion table. If so, it will divide the value of the quantity (Qty/Quantity from) and multiply it times Conversion factor.
In example, will be 176/88*220. And also change UOM for the value of Unit to enter.

I have this table:
image

And I want to convert it to next table per each row. This should be the result
image

Looking up in the following conversion table
image

How can I do all those operation? I’m a little bit new with advanced options like this

Hi @JavRR

You may follow the below steps to achieve the result.

  1. Read the input file/table (inputDT)

  2. Read the Conversion table (conversionDT)

  3. Create a output table (outputDT)

  4. Use a loop to process each row in inputDT

  5. Use linq to get matching row from conversionDT

  6. Perform operation to get new Qty, UOM values and add these values as a new row into resultDT

  7. Write the outputDT to a excel file outside the looping block

can you provide sample file

what is the action if the data is not matched , as you said if matched you want to do something what if it is not found

Regards

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.