Check the "OTA preference" in the excel and compare it to the "New %"

Hi Team,

check the “OTA preference” in the excel and compare it to the “New %”.

image

I have to check below points from Excel

a)0% should have an OTA of “SCCP policing” or “Forbidden”
b)0+% should have an OTA of “Non-preferred”
c)>0% should have “Priority”
4)Any numerical percentage should be “Preferred”

thanks
shaik

Do we need to guess the requirements? Please provide complete input and expected output.

need to check all points if not matched then send exception mail

thanks
shaik

Just do your logic in Excel and have a new column with True/False results. Read the data and go through the datatable issuing the exception mail when finding False on the control column.

No need to add New columns here, just i have to check if false then send exception

Can anyone send sample workflow

thanks
shaik

Hi @shaik.muktharvalli1

Can you please try below

DT.AsEnumerable().Any(Function(row) _
    (row("New%").ToString = "0%" AndAlso Not (row("OTA Preference").ToString = "SCCP Policing" Or row("OTA Preference").ToString = "Forbidden")) _
    OrElse (row("New%").ToString = "0+" AndAlso row("OTA Preference").ToString <> "Non Preferred") _
    OrElse (row("New%").ToString.Contains("%") AndAlso Not (row("New%").ToString = "0%" Or row("New%").ToString = "0+") AndAlso row("OTA Preference").ToString <> "Priority") _
    OrElse (IsNumeric(row("New%").ToString.TrimEnd("%"c)) AndAlso row("OTA Preference").ToString <> "Preferred"))

Regards,

Hi @lrtetala

not working sir, can you send sample workflow

thanks
shaik

Thank you @lrtetala

Thanks
Shaik

Hi @lrtetala

Fourth point change from client side, if any numerical percentage should be first having numerical value like “1st Preferred” or “2nd Preferred”

I have to check first letter have numerical value or not if not then send business exception

thanks
shaik

Hi @shaik.muktharvalli1

Can you try the below

DT.AsEnumerable().Any(Function(row) _
    (row("New%").ToString = "0%" AndAlso Not (row("OTA Preference").ToString = "SCCP Policing" Or row("OTA Preference").ToString = "Forbidden")) _
    OrElse (row("New%").ToString = "0+" AndAlso row("OTA Preference").ToString <> "Non Preferred") _
    OrElse (row("New%").ToString.Contains("%") AndAlso Not (row("New%").ToString = "0%" Or row("New%").ToString = "0+") AndAlso row("OTA Preference").ToString <> "Priority") _
    OrElse (IsNumeric(row("New%").ToString.TrimEnd("%"c)) AndAlso Not IsNumeric(row("OTA Preference").ToString.Trim()(0)) AndAlso row("OTA Preference").ToString <> "Preferred"))

Regards,

1 Like

Thank you @lrtetala, it’s working fine.

Thanks
Shaik

1 Like

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