Hello
I am struggling to add a Formula to return 1 if Created date is prior to Log date, other wise 0
I have tried
IF [LoginTime]<[CreatedDate]THEN'1' ELSE'0' ENDIF
but system does not like it
Has anyone got some sample or example of similar approach?
thank you
Myriam
Solved! Go to Solution.
How about:
IIF([Created Date] < [Log Date],1,0)
make the data type BYTE.
If you define the data type as V_Wstring or any string, you'll run into errors. That's because 0 & 1 are numbers. If you want "0" or "1" as strings, then quotes are needed.
Cheers,
Mark
I imagine the fields are not properly formatted as "dates." Check the meta data in your results window to verify.
Use the DateTime tool under "Parse" Alteryx has included a great help file if you click on the tool, then click open examples. In this case you'll want to use the "String to Date/Time Format"
Then you'll add a formula tool with the expression:
iif([Created Date]<[Log Date],1,0)