Check whole column Contains the same value

Hello Team,

Is there a way to check the whole column data contains 1.1

Example ANA is a column name that contains 1.1 so it should return true so further actions can be performed

ANA | JNN
Amt | Amt
An01|Jn03
1.1 | 2.3
1.1 |2.3
1.1 |2.3
1.1 |2.3
1.1 |2.3

Hi,

How about the following condition?

dt.AsEnumerable.All(Function(r) r("ANN").ToString.Contains("1.1"))

image

Regards,

@anmita

Check here

image
Sequence.xaml (8.4 KB)

Hi @anmita - Try the below exp

Variable of type Data Table (DT1) = DT.AsEnumerable.Where(Function(x) Not x(0).ToString.Equals("1.1")).CopyToDataTable
  • It returns the data table contains any value beside 1.1 to DT1. If there are no, it simply gives an exception that you can handle using Try Catch block. In the catch block you can take a boolean variable set to True
  • This gives an idea, if this variable is set to True, that means there are value other than 1.1 in that column, else no

Check attached workflow

DataTable.zip (2.9 KB)

Hii @Yoichi

Thanks for the quick response can we check after 2 lines after column name

field

Thanks @Manju_Reddy_Kanughula

Thanks @ushu

HI,

How about the following?

dt.AsEnumerable.Skip(2).All(Function(r) r("ANN").ToString.Contains("1.1"))

Regards,

Thank you @Yoichi

1 Like

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