How to Compare Column 1 quantity to column 2 quantity i.e column 1 values is less than or equal to column 2

image
all column 1 values should be less than column2 and return Boolean value

Hi @Prateek_Gulab_Pathak

Try this

isAllValuesless =DT.AsEnumerable().All(Function(row) CInt(row("Column-1")) <= CInt(row("Column-2")))

Cheers!!

@Prateek_Gulab_Pathak

Dt.AsEnumerable.All(function(x) Cdbl(x("Col1").ToString) <= Cdbl(x("Col2").ToString))

This gives true if all rows satisfy else false

Cheers

Hi @Prateek_Gulab_Pathak

=> Read Range Workbook
image
Output-> dataTable

=> Use below syntax in Assign:

Assign-> bool_rows = dataTable.AsEnumerable().Any(Function(row) Convert.ToInt32(row("Column-1")) <= Convert.ToInt32(row("Column-2")))

bool_rows is of DataType System.Boolean.

Hope it helps!!

@Prateek_Gulab_Pathak

Assign activity:
ResultBoolean = dt.AsEnumerable().All(Function(row) Convert.ToDouble(row("Column1")) < Convert.ToDouble(row("Column2")))


thanks for the solution
It worked!!!

1 Like

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