Compare variables and Catch the Max value from the variable

NewValue OldValue
60.50 55.50
53.50 56.50

I have created loop and stored values in 2 different variables

Variable 1 = NewValue
Variable 2 = OldValue

If value of NewValue = 60.50 and OldValue = 55.50

keep value of variable NewValue = 60.50

If value of NewValue= 53.50 and OldValue = 56.50

keep value of variable NewValue= 56.50

logic in Excel is shown below

I need help in executing this logic in Uipath by assigning values into variable and try to find max value and at the end i will display result in message box

is it possible to bring it within a general rule like e.g catch the max value from New/OldValue?

may we ask you to answer the question. Once we cleared the requirement / evaluation rule then we will look for the matching solution approach. Thanks

Yes, I need to find max value from both variables(NewValue and OldValue) and store output in another variable called “Result”

when variable type (New/OldValue) is Double:

Assign Activity:
myMaxNumber | Double =
{Variable1,Variable2}.Max()

When variable type is String / coming from datatable:
We will convert into a double

Assign Activity:
myMaxNumber | Double =
{CDbl(Variable1),CDbl(Variable2)}.Max()

Datatable origins / row is current looped row e.g. for each row
Assign Activity:
myMaxNumber | Double =
{CDbl(row(“NewValue”).toString.Trim,CDbl(row(“OldValue”).toString.Trim}.Max()

Thank you it worked.

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