Hi, i’m trying to write some conditional If/Then statements within the IF activity in my workflow. I am attaching a excel sheet of some dummy variables with the same column names I have in my worksheet.
dummy variables.xlsx (10.1 KB)
I’m trying to run a few tests which for some reason are not working. I have the if/then statement setup properly and the tests run properly for some of the simpler tests but the more complex one’s are eluding me.
For example: I want to test if an expense is paid for by the company but it’s not related to airfare or hotels which is a violation.
What i’ve tried so far is:
(PaymentType.Equals(“Company Paid”) And (ExpenseType=Not(“Hotel”) Or ExpenseType =Not(“Hotel Tax”) Or ExpenseType =Not(“Airfare”) Or ExpenseType =Not(“Airline - Baggage Fee”)))
I have also tried
(PaymentType.Equals(“Company Paid”) And (ExpenseType.IsNot(“Hotel”) Or ExpenseType.IsNot(“Hotel Tax”) Or ExpenseType.IsNot(“Airfare”) Or ExpenseType.IsNot(“Airline - Baggage Fee”)))
I also want to run a test that determines if the expense is paid for using the BofA mastercard and is a business expense.
How I tested that is"
Payment Type <> (“BofA Mastercard”) AND expense type = (“Meals - Trip Overnight”)
Payment Type <> (“BofA Mastercard”) AND expense type = (“Car Rental”)
Payment Type <> (“BofA Mastercard”) AND expense type = (“Meals - Clients”)
I was not able to Nest all of the conditions into one statement so I ended up creating 9 different if statements, one for each statement. If you could help me learn how to nest these conditions into one statement, that would be a huge help.