Start Free Trial

Weekly Challenges

Solve the challenge, share your solution and summit the ranks of our Community!

Also available in | Français | Português | Español | 日本語
IDEAS WANTED

Want to get involved? We're always looking for ideas and content for Weekly Challenges.

SUBMIT YOUR IDEA

Challenge #41: Analytics PayPeriodCalc

mirzaglamocak_alteryx
8 - Asteroid
Spoiler
mirzaglamocak_alteryx_0-1759190782162.png

 

Ruben_Occ
7 - Meteor
Spoiler
Ruben_Occ_0-1760131328745.png

 

icchung
8 - Asteroid
Spoiler
icchung_0-1761061014816.png


Formula Tool Contains:

1+ inclusive of both start and end dates

DateTimeDiff([P1_End],[P1_Start],"days")*5 Get total calendar days in the range

DateTimeFormat([P1_Start], "%w")  Start day (0=Sun, 1=Mon... 6=Sat)

DateTimeFormat([P1_End], "%w")  End day

ToNumber() converts text to numbers for math
(start_day - end_day)*2 Multiplies by 2 because there are 2 weekend days per week

/ 7 Normalizes the calculation to account for full weeks
IIF(DateTimeFormat([P1_End], "%w")=="6",-1,0) Ensures Saturdays are never counted as workdays
IIF(DateTimeFormat([P1_Start], "%w")=="0",-1,0)Ensures Sundays are never counted as workdays