Find the max date from datattable and compare it with another date then update the column

Please suggest query for this
To find the max date from row of three columns and compare it with another column
Then update the particular column

The exact requirement is in the excel
With input and output
testfile - Copy.xlsx (15.3 KB)

@Brian_Mathew_Maben could you please help this as well at the earliest

@Anil_G could you please suggest

@Demo_User

I see few rows dont have a date at all should they be ignored?

Cheers

Yes, they should be ignored, if those columns are empty

@Demo_User

Please check this…also the output you provided looks wrong as all the dates are greater

dt.AsEnumerable.ToList.ForEach(Sub(r) r(18) = If(Not String.IsNullOrEmpty(r(9).ToString) AndAlso CDate(r(5).ToString)>CDate(r(9).ToString),"Quality is best",If(Not String.IsNullOrEmpty(r(9).ToString) AndAlso CDate(r(5).ToString)>CDate(r(11).ToString),"Quality is best",If(Not String.IsNullOrEmpty(r(9).ToString) AndAlso CDate(r(5).ToString)>CDate(r(13).ToString),"Quality is best",If(Not String.IsNullOrEmpty(r(9).ToString) AndAlso CDate(r(5).ToString)>CDate(r(15).ToString),"Quality is best",If(Not String.IsNullOrEmpty(r(9).ToString) AndAlso CDate(r(5).ToString)>CDate(r(17).ToString),"Quality is best","Quality is Worst"))))))

This is to be used in invoke code with dt as in/out and also read data from A3

cheers

Hey @Demo_User ,

Try using this workflow:

Main.xaml (6.9 KB)

Expected output:
Output.xlsx (8.0 KB)

Hey @Demo_User Any updates?

If r(1).Equals(Asley) then i need to check this condition and update the column
Could please append this condition with the condition u have sent

If r(1).Equals(Asley) then i need to check this condition and update the column
Could please append this condition with the condition u have sent

Any update please let me know

@Demo_User

Please use this

dt.AsEnumerable.Where(function(x) x(1).Equals("Ashley")).ToList.ForEach(Sub(r) r(18) = If(Not String.IsNullOrEmpty(r(9).ToString) AndAlso CDate(r(5).ToString)>CDate(r(9).ToString),"Quality is best",If(Not String.IsNullOrEmpty(r(9).ToString) AndAlso CDate(r(5).ToString)>CDate(r(11).ToString),"Quality is best",If(Not String.IsNullOrEmpty(r(9).ToString) AndAlso CDate(r(5).ToString)>CDate(r(13).ToString),"Quality is best",If(Not String.IsNullOrEmpty(r(9).ToString) AndAlso CDate(r(5).ToString)>CDate(r(15).ToString),"Quality is best",If(Not String.IsNullOrEmpty(r(9).ToString) AndAlso CDate(r(5).ToString)>CDate(r(17).ToString),"Quality is best","Quality is Worst"))))))

cheers

But it will return only the datatable with the column have ashely right?
I want the whole datatable but ashley value should have this as output incorporated
Could you please suggest,

@Demo_User

Ideally it would return all…but only update ashley…can you please try

Cheers

Okay will check on the same

1 Like

It works thanks for your inputs

Thanks for your input it works

1 Like

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