Dear all,
I've tried to find the answer to my question but I have been unsuccessful. I am trying to build a flow to display in Power BI the list of Employees having their work anniversary, based on their hire date. I am therefore trying to find a formula that would enable me to return "1" in a new field if the day and month of their hire date falls between the day & month of today's date +/- 7 days (and return "0" if not of course). This way, i could extrat all people showing "1" as having their work anniversary in the past or coming week. The problem is that i have the feeling that Alteryx is not equipped to process operations on dates ignoring the year. Not so sure how to approach this. Would someone have a brilliant idea to share? 🙂 Million thanks in advance!
Solved! Go to Solution.
@lisebiss you could use the DateTimeFormat function to separate out the day and month. You could alternatively use the DatetimeAdd function.=> DateTime Functions | Alteryx Help
Hope this helps.
Removed as my solution wasn't working for this use case 😅
Hello ! Thanks to both of you ! @Jean-Balteryx I cannot really share the whole file because their are confidential data in their but basically it looks like this below. I have tried a formula based on what you mention @Prashant Chamarty but it returns errors, look 😞 That being said I have basically no idea what I am doing, I started with Alteryx a week ago 😄
I think @atcodedog05 's solution solves your problem !
Thank you @atcodedog05 !!!!!!!!!!!!!!! (and thanks to everyone else as well :)) 😎
Happy to help : ) @lisebiss
Cheers and have a nice day!
I'm being perfectionist here, but when you have to compare to x and -x, you can use Abs() function to simplify your condition :
IF Abs(DateTimeDiff(DateTimeToday(),[Current Year Occurrence],"days"))<=7
THEN 1
ELSE 0
ENDIF