In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests after December 31, 2025. Set up your security questions now so you can recover your account anytime, just log out and back in to get started. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

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

Calculating how many days to next Friday

Deano478
12 - Quasar

Hi all,

 

I have the dates below:

 

2023-01-13
2023-01-20
2023-01-27
2023-02-03
2023-02-03
2023-02-03
2023-02-10
2023-09-15
2023-02-03

What i'm trying to figure is how to calculate how many days it is until the next Friday from these dates it should be easy enough but i cant seem to get my head around it. 

 

Cheers for nay help in advance

4 REPLIES 4
lwolfie
11 - Bolide

I would use something like 5-DateTimeFormat([Date], "%w").  %w returns the day of the week as a number from 0-6, starting on Sunday.  Friday would be a 5 so it would be subtracting the day from 5.

Luke_C
17 - Castor
17 - Castor

hi @Deano478 

 

Here's how I'd approach:

 

  • Add 7 to the date
  • Generate 1 row for every day between the two
  • Add formatting to show day of week (you can collapse this into the filter tool but wanted to show you for clarity)
  • Filter on Friday

image.png

binu_acs
21 - Polaris

@Deano478 

DateTimeAdd(DateTimeAdd([Date],5-ToNumber(DateTimeFormat([Date],"%w")),"days"),7,'days')

image.png

apathetichell
20 - Arcturus

fyi - this technically this is "the next friday" - calculating days till "next friday" - ie the next occuring friday after "this friday" would require wrapping @binu_acs 's nifty 5-xxxx statement in a mod(...,5) to correctly skip this friday.

Labels
Top Solution Authors