I have 3 condition But I want combine to 1 condition for check data as below.
condition1
If(dt_input.AsEnumerable().Any(Function (row) row(“Create ID”).toString.Length >= 6 AndAlso
row(“Check_Cat”).toString =“Y” AndAlso
row(“Check_DivisionValidation_CM”).toString =“N”), True, False)
condition2
If(dt_input.AsEnumerable().Any(Function (row) row(“Create ID”).toString.Length >= 6 AndAlso
row(“Check_Cat”).toString =“Y” AndAlso
row(“Check_DivisionValidation_CM”).toString =“Y” AndAlso
row(“Check_Owner”).toString =“N”), True, False)
condition3
If(dt_input.AsEnumerable().Any(Function (row) row(“Create ID”).toString.Length >= 6 AndAlso
row(“Check_Cat”).toString =“Y” AndAlso
row(“Check_DivisionValidation_CM”).toString =“Y” AndAlso
row(“Check_Owner”).toString =“Y”) AndAlso
row(“remark”).toString =“N”), True, False)
Can you guide me forr solve it.
Hi @fairymemay ,
Try like this, hope it helps you
If(dt_input.AsEnumerable().Any(Function (row) row("Create ID").ToString.Length >= 6 AndAlso row("Check_Cat").ToString = "Y" AndAlso row("Check_DivisionValidation_CM").ToString = "N" OrElse (row("Check_DivisionValidation_CM").ToString = "Y" AndAlso row("Check_Owner").ToString = "N") OrElse (row("Check_DivisionValidation_CM").ToString = "Y" AndAlso row("Check_Owner").ToString = "Y" AndAlso row("remark").ToString = "N")), True, False)
Regards,
Vinit Mhatre
1 Like
@Vinit_Mhatre I apply your code to copy datatable but error as below.
dt_input.AsEnumerable().Any(Function (row) row("Create ID").ToString.Length >= 6 AndAlso
row("Check_Cat").ToString = "Y" AndAlso
row("Check_DivisionValidation_CM").ToString = "N" OrElse
(row("Check_DivisionValidation_CM").ToString = "Y" AndAlso
row("Check_Owner").ToString = "N") OrElse
(row("Check_DivisionValidation_CM").ToString = "Y" AndAlso
row("Check_Owner").ToString = "Y" AndAlso
row("remark").ToString = "N").CopyToDataTable
Hi @fairymemay ,
Try this
dt_input.AsEnumerable().Where(Function(row) row("Create ID").ToString().Length >= 6 AndAlso row("Check_Cat").ToString() = "Y" AndAlso ((row("Check_DivisionValidation_CM").ToString() = "N") OrElse (row("Check_DivisionValidation_CM").ToString() = "Y" AndAlso row("Check_Owner").ToString() = "N") OrElse (row("Check_DivisionValidation_CM").ToString() = "Y" AndAlso row("Check_Owner").ToString() = "Y" AndAlso row("remark").ToString() = "N"))).CopyToDataTable()
Regards,
Vinit Mhatre
1 Like
mkankatala
(Mahesh Kankatala)
6
If you want the output as Boolean then you have to use the code provided by @Vinit_Mhatre
If you need the output any other datatype then let us know. Be more elaborate then only we will provide you the proper result for you… @fairymemay
1 Like
system
(system)
Closed
7
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.