Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

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

NicoleDuhamel
8 - Asteroid

solution attached

NicoleDuhamel
8 - Asteroid

NicoleDuhamel_0-1626943538930.png

@romie75 

Here's the workflow that I used - logic is like this:

- Record ID first so you've got a unique identifier for each row,

- Transpose to bring all of the date columns into one column & DateTime to convert that column to date format. This means that you don't have to convert each of the initial columns separately.

Text to Columns splits out the period ref from the start/end, so you can use the CrossTab to get the Start and End dates in different columns.

 

At this point you now have a Name column (which identifies if it's P1 or P2), an End date column and a Start date column. With the data in this layout you can use Generate Rows to add rows for each individual day. You can then use a formula to format each date with the day name and the month name , so you can remove the weekend days.

 

Once you have the day names and month names in separate columns, add a filter to remove Saturdays and Sundays and then use a Summarize tool to count the number of weekdays for each group & month. Then a CrossTab to show the P1 and P2 groups in their own columns.

jcollake
6 - Meteoroid
Spoiler
jcollake_0-1627063307521.png

 

Solved.

dfurlow
8 - Asteroid

This was useful for dateTimeFormat practice, especially.  Don't think i will remember the formats like %B, %a, %Y, so it's good to have a workout.

ExploreMore
8 - Asteroid

 

This one took me for a little bit of a ride! I almost solved it without having to run the workflow to check my work in the middle of building it!

Spoiler
Screenshot 2021-07-25 110821.png

 

The link below was definitely helpful. 

DateTime Functions | Alteryx Help

BenFr
Alteryx
Alteryx

Quite proud of this one...even if it took me far too long!

Spoiler
BenF2_0-1627401310207.png

Logic for formulas to calculate the weekend days:

 

//Sum up duration of pay period and the day that the pay period started on (have to change a Sunday 0 code to 7)

//Divide this number by 7, floor to round down and times this by 2 to get the total possible weekend days in the starting week and pay period

2*Floor((IIF(ToNumber(DateTimeFormat([P1 Start_Out],'%w'))==0,7,ToNumber(DateTimeFormat([P1 Start_Out],'%w')))+[P1 Dur])/7)+

 

//Take away one if ends on a Sat
IIF(ToNumber(DateTimeFormat([P1 End_Out],'%w'))==6,-1,0)+

 

//Take away one if starts on a Sunday
IIF(ToNumber(DateTimeFormat([P1 Start_Out],'%w'))==0,-1,0)

 

VizChic
11 - Bolide

FG soln AA 41

carmenrapariz
8 - Asteroid
Spoiler
Challenge 41.PNG
kcfuiks
8 - Asteroid

Messy but complete. 😅

RashedDS
8 - Asteroid

My solution

Spoiler
RashedDS_0-1628423150659.png