Hi, I am trying to create a conditional statement where I output "Stage 2" for assets that fall between months 4 - 32. The problem is that I want it for assets with lease terms of 36 months. In my data set, I have assets with lease terms of both 36 and 48 months. Is this possible using a conditional statement? This is what I have but I am getting an error: IF [Term] == "36" && [Asset Period] >= "4" && [Asset Period] <= "32" THEN "Stage 2" ELSE "Stage 3" ENDIF
Solved! Go to Solution.
Hi there,
Just change your syntax:
IF [Term] = "36" and ([Asset Period] >= "4" and [Asset Period] <= "32") THEN "Stage 2" ELSE "Stage 3" ENDIF
I am still getting the same error message. "Invalid type in operator =="
@Chirag_Gandhi07 Are your fields numeric or strings? If they're numeric, get rid of the quotes.
Could you attach your Alteryx workflow, then we'll be in a better position to help
@Chirag_Gandhi07 When you create your Asset Period field, make it a numeric data type. You will have to change the "0" to just 0 for this to work.
Additionally, do you want your fields to equal the string "Null" or be null? As of now, you are assigning the string value of "Null" to your fields. If this is not what you want, use Null() instead.