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
@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
Hi @JPAEP, try this
Thanks!
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])
@JPAEP another way of doing this with the IIF statement
IIF([O2]-[K2]=0,1,[O2]-[K2])
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.
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')
@JPAEP you definitely can. Would you be able to give a quick example table with your variables and desired output?
So essentially, even though these were finished the same day, I would still want a 1 in the scheduled days to Work Column. So the calc I had was right, just need extra to make it more correct.
Ah thanks @JPAEP, looks like @grazitti_sapna has already sorted that logic for you.