How to Identify and remove Overtime and standby option Infront name

Hi All

How can I identify Standby and Overtime , expense in front of name in line description
and once its identified only name need to extracted

i have tried below expression but its not working
str_EmployeeName.ToString.Contains(“- Overtime”) And str_EmployeeName.ToString.Contains(“- Standby”) And str_EmployeeName.ToString.Contains(“2x overtime”) And str_EmployeeName.ToString.Contains(“- Expense”)

Can any one help me on this

image

Hi @Sam_H,

Try using Ors instead of Ands:

str_EmployeeName.ToString.Contains("- Overtime") Or
str_EmployeeName.ToString.Contains("- Standby") Or
str_EmployeeName.ToString.Contains("2x overtime") Or
str_EmployeeName.ToString.Contains("- Expense")

In an if statement this should match True when it contains any of those 4 items. When using Ands, it was looking for all 4 in one value.

Edit: You could also shorten the expression down to 3 items by checking the string when it’s lowercase:

str_EmployeeName.ToStringToLower.Contains("overtime") Or
str_EmployeeName.ToString.ToLower.Contains("standby") Or
str_EmployeeName.ToString.ToLower.Contains("expense")

Hi @william.coulson

How can I pick only the name once its identify these option

Hi Sam,

Try this in an assign:

str_EmployeeName = str_EmployeeName.ToString.Split({"-"},StringSplitOptions.None).First.Trim

Your expressions have “- Overtime” and “2x overtime” but in the data they’re “-Overtime” and “2x Overtime”

Your expressions don’t match what’s in the data. You have to be accurate on these things.

You should Split these on - to separate the name from the other info. Best way would be to use the Table Extraction wizard to scrape the data, then you can split the column into two. Then you’ll have a name column and a details column or whatever you want to call them. Then you can use activities like Filter Datatable.

@postwick Please let me know how to update the expression

Make the values in your expression exactly match what’s in the data.

“- Overtime” and “-Overtime” are two different strings.

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