How to update specific row value based on condition

PFA,

Scenario is if total hours is greater than 40 i have to update all “OT” columns dynamically w.r.t Total hours column …

Any suggestions

Thanks in advance

@rsr.chandu ,

Can you be more specific with your question?
If Total hours is > 40, then what values you need to update and under which columns you need to update?

Regards,
Rohith

If it is > 40, i need to update Mon OT, Tue OT columns etc…
The values are eg:
Mon OT= Moncol value-total hrs
like wise

HI @rsr.chandu

Have a look on the XAML file

Subtraction → CInt(row(“Mon”).ToString)-CInt(row(“Total”).ToString)

UpdateOT.xaml (9.4 KB)

Regards
Gokul

Hi,

  1. Use Read range and read the Input Data and store it in dt_Input.
    Use assign and do dt_Output = dt_Input.Clone(). Use for each to loop through the Datatable,
  2. Inside for each use If Condition [Cint(row(“Total hours”).ToString) > 40]
  3. In then Part you can use create a data row variable and add the values for required columns by computing the difference between required 2 columns & then use add Data row to add the updated data to add to your Output Dt.
  4. In Else Part add the Row to Output Dt without any changes.

Regards,
Rohith


I am getting like this

Hi @rsr.chandu

not String.IsNullOrEmpty(row("Mon").ToString)

Updated XAML

UpdateOT.xaml (14.0 KB)

image

Regards
Gokul

1 Like


I am getting like this

HI @rsr.chandu

Output is correct or do you facing any error

Subtraction → CInt(row(“Total”).ToString)-CInt(row(“Mon”).ToString)

Regards
Gokul

I need to do subtraction if total is greater than 40
bot is doing for all values

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