Sometimes you will want to set a frequency for a task/object to recur either mon Monday, Wednesday, Friday or Tuesday, Thursday. To do this, we utilize the Weekday()
formula to determine the numeric value for the day of the week:
-
Sunday
-
Monday
-
Tuesday
-
Wednesday
-
Thursday
-
Friday
-
Saturday
We also need to know what the numeric value of Today is, so we can increment from that. This is accomplished by pairing the Today()
formula with Weekday()
. Create a canvas formula called:
TodayNumber = Today().Weekday()
Using SwitchIf()
we can contemplate the various conditions. Using [Mon, Wed, Fri]
and [Tue, Thu]
as the two possible frequency conditions we get:
Switchif(
and(thisRow.Frequency=[Mon, Wed, Fri],TodayNumber.in(list(1,3,5,6,7)),
today().workday(1),
and(thisRow.Frequency=[Mon, Wed, Fri],TodayNumber.in(list(2,4)),
today().workday(2),
and(thisRow.Frequency=[Tue, Thu],TodayNumber.in(list(2,4)),
today().workday(1),
and(thisRow.Frequency=[Tue, Thu],TodayNumber.in(list(1,3,6,7)),
today().workday(2),
and(thisRow.Frequency=[Tue, Thu],TodayNumber=5),
today().workday(3)
)