Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

bi-weekly formula help needed

Brad1
11 - Bolide

Hi,

 

I'm needing a formula that can determine if an even number of weeks have passed since a given date.  In other words StartDate = 2022-10-14.  That is a Friday.  When the WF runs I need a 'Y' if run at two weeks and four weeks etc. and a 'N' on all other days.

 

This is needed because the scheduler can't do every other Friday.  

 

Thanks in advance for any help.

5 REPLIES 5
CarliE
Alteryx Alumni (Retired)

Hi @Brad1 ,

 

CarliE_1-1665166790703.png

 

 

You can use a formula to get the difference in weeks between the start date and the date and then use a formula to say if its even or odd.

Does this help to solve your problem? If so, please be sure to mark it as a solution

Carli
Brad1
11 - Bolide

I changed the formula to this abs(ceil(DateTimeDiff([start date],DateTimeToday(),'days')/7))

and will only use one Start Date from the Input and won't need a grid of future dates.

 

It works.  Thanks.

joelmiller66
9 - Comet

@Brad1 You also can also identify the week number for the calendar year by using the specifier %W. 

 

This will make it easier to get the difference calculation.

 

Example: DateTimeFormat([Date],"%W")

joelmiller66_0-1665170339233.png

 

 

Brad1
11 - Bolide

This my altered answer from Carli.  Thanks everyone.  I now have a bi-weekly scheduled WF.  I join in results with a hard-coded 'Y' and results either make to the end of the WF and get emailed or the don't.

 

Brad1_1-1665223547755.png

 

Brad1
11 - Bolide

Dynamic Bi-Weekly Schedule example.

Labels