Expand my Community achievements bar.

how to create a weekday condition in a segment?

Avatar

Level 2

Hi,

 

I need to set up a delivery that will be sent to relevant passengers 2 days before their flight.
The delivery should only be sent to passengers departing from a certain airport on Saturday.
In order to create this segment I need to use the Day of week date formula on my Departure date parameter and then set up another rule/condition that will check if there's a relevant flight 2 days from now.

 

How do I do that?

6 Replies

Avatar

Community Advisor

Hi @MariBa ,

You can utilize WeekDay() function in Enrichment/Query/Split. The output value for this function will be 0 to 6, where 0 as Monday and 6 as Saturday.

So for example, if you want to trigger only on Saturday, give the condition as,

WeekDay(GetDate()) equal to 6

Avatar

Level 2

Hi,
Thanks for the quick reply!

I tried to set it up but I must have done it wrong because I'm not getting any flights.
I haven't set up the condition to check if the departure date is 2 days away.
I started with the first part of getting all flights departing on saturdays but it's not working.

See the screenshot I've attached.

 

MariBa_0-1734532498572.png

 

Avatar

Community Advisor

@MariBa ,If your field DPT_DTTM is of date / datetime data type, then it should be like WeekDay(@DPT_DTTM) equal to 6

 

Avatar

Level 2

now it's working!

How do I set up the condition that checks if the departure day is 2 days away and only then the delivery will take place?

Avatar

Level 2

I did something a bit different and it seems to be working.
I used the "refine the target using additional data" and then defined it this way:

MariBa_0-1734592037693.png