Hi,
I have got two data tables, exact same structure, i.e. each data table has 4 columns: 2 String type Columns, 2 Double type Columns)
Now I need to Check the variance from DT1 column 4 and DT2 column 4 (which are of double type) and check if the difference is greater than 0.5
Ok I will make a quick workflow. One thing first, is your datatable in column 4 being stored in type string and need conversion or is it being stored in the double type already?
For Each Row - DT1 (row1)
For Each Row - DT2 (row2)
If row1.Item(0) = row2.Item(0) Then
If (row1.Item(3) - row2.Item(3)) > 0.5 Then
Do Some Code ---
Break - Assuming you are done with that row from DT 2
This will loop through each row in DT 1 and do comparison to all rows in DT2 if first column value matches - If there could be multiple matches from column 1 on datatable 2 then remove the Break.
Both do the same things, having it as a workflow will look and read better - where possible its best to avoid to many nested Ifs in a sequece and it cant be untidy.
Both work the same, it depends on which make sense to you and your team. Generally, for many nested if statements, flow chart with flow decision is easier to read than if statements.