I'm sure this is probably pretty easy, but I'm struggling with the "1" in the middle of the formula. But how would I write this in Alteryx?
=IF(O2-K2=0,1,(O2-K2))
Thanks in advance!
Jordan
Solved! Go to Solution.
It would write this as,
IF [Field_O]=[Field_K] THEN 1 ELSE [Field_O]-[Field_K] ENDIF
Hey @JPAEP,
Is this what your looking for:
IF ([O2]-[K2]) = 0 THEN 1 ELSE [O2]-[K2] ENDIF
Any questions or issues please ask :)
HTH!
Ira
You can also use the ternary formula,
IIF ([Field_O] = [Field_K], 1, [Field_O] - [Field_K])
I'm super close on this, but it doesn't like the ending on these. See below. Even if I bracket the last part, it still will not run.
@JPAEP you will need to convert your data to number as its currently text try:
IIF(toNumber([O2])-toNumber([K2])=0,1,toNumber([O2])-toNumber([K2]))
Or just change there data type using a select tool
Thank you sir!
No worries @JPAEP ! :)
This was close getting me there, then I realized it was date related data. So I used the DateTimeDiff formula and it gets me really close, I just need anything that is a 0 to turn into a 1. Can I do the DateTimeAdd with the Diff to get the intended result? Formula below.
DateTimeDiff([CON Start],[CON Finish],'days')