Hi Alteryx experts,
First of all, I hope everyone is doing well and safe from the COVID-19. I am new to Alteryx and need some help with the formula tools to set some certain criteria for an output.
I am trying to find multiple criteria across two columns and if it can output "ABC2" in column A
An example is: if the time is >=22 or <8 or it shows "Y" in weekend column, then it will automatically fill in "ABC2" for type column
Is the expression below correct? Looks like the it is throwing my output off due to the "tried to apply string operator to a numeric value error"
IF Contains([Time], ">=22") or Contains([Time], "< 8") or Contains([Weekend], "Y")
THEN [Type],"ABC2" ELSE Null()ENDIF
Appreciate if you gurus can guide, how to achieve this.
Regards
Solved! Go to Solution.
Hi @Jimmylee4real, try setting up your formula as
IF TONUMBER([Time]) >=22
or TONUMBER([Time]) < 8
or Contains([Weekend], "Y")
THEN "ABC2" ELSE Null()
ENDIF
Let us know if this doesn't resolve the error.
hello AbhilashR,
thanks for the solution and one more step to go.
After using your formula, all the previous records on column "Type" has also changed into ABC2. Is it possible to set a formula to change on null values only with the criteria while all the previous records remain the same?
thank you so much
Let me try to make it abit more clear here:
when the "time" column is "null", i want the type column to remain the same.
Hi @Jimmylee4real,
Modify the formula by adding IF IsNull([Time]) THEN [Type] ELSEIF to the beginning of your formula in place of the initial IF:
IF IsNull([Time]) THEN [Type] ELSEIF ToNumber([Time]) >=22 OR ToNumber([Time]) < 8 OR Contains([Weekend], "Y") THEN "ABC2 ELSE Null() ENDIF
thank you so much for assistance and kindness!
btw is it possible to create a pivot table in Alteryx?
What is equivalent to "filters", "values" and "rows" in Alteryx? thanks once again