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 #80: Slowly Changing Dimensions

ChristineB
Alteryx Alumni (Retired)

Last week's solution has been posted here

 

This week's challenge explores the problem of Slowly Changing Dimensions, which some of you may be familiar with as you update existing or historical data with changes to those attributes.  In this challenge, we'll be updating our log of Jedi rankings to reflect changes in Jedi levels, promotions, and retirements (yes, even the Jedi Knighthood has an HR department). 

 

The challenge's Start file contains an input of the "Current Log", which includes data on an individual's level, when they started at that level, and when they completed that level. Records with an end date indicate either a promotion or a separation for that individual.  The input "Today's Updates" includes the changes that take effect today: Bob has joined the Dark Side, Kaitlin and Richard have been promoted up the Jedi Ranks and Joe has joined the Jedi Knighthood. Your task: create a workflow that produces an updated list of the current Jedi ranks.

 

Use the Force...er...Alteryx!Use the Force...er...Alteryx!

 

 

 

 

 

 

NicoleJohnson
ACE Emeritus
ACE Emeritus

My solution! Welcome to the Dark Side, Bob...

 

89feed0a704a9706f4924c5f831a2d23.jpg

 

 

Spoiler
WeeklyChallenge80.JPG

 

nick_ceneviva
11 - Bolide

Fun Challenge!  Made the assumption that if a record successfully joins on both name and level then it is being included and should be closed.  This is how Bob's record drops out.

 

Spoiler
Capture.PNG
patrick_digan
17 - Castor
17 - Castor
Spoiler
I was able to use a couple joins and formula tools along with a union.
Capture.PNG
Joe_Mako
12 - Quasar

It is also good to verify the workflow logically, if Bob had more than one record in the Current Log, would it still work as expected?

 

 

Spoiler

 Here are my two routes, one with mostly Multi-Row Formula tools, and another with mostly Joins.

Route 1:
route 1.png
- Union Current Log and Today's Updates
- Sort by Name and Start Date
- Multi-Row Formula updates End Date if Current Flag is "Y"
- Multi-Row Formula updates Current Flag if there is no next record for Name, then Current Flag is "Y" else "N"
- Filter to find "Y" Current Flag Records with an End Date
- Join by Name to remove records with those Names



Route 2:
route 2.png
- Join by Name, Level, Start Date. Names that join here can be removed
- Join by Name to remove the newly ended
- Formula on record that came out the Left of the first Join, add Flag Fields
- Join by Name, Current Flag. Records that Join need the Prior record to be updated. Left are record that need no change
- Union records to keep. 1. Existing records with no change needed. 2. New Records. 3. Existing records that needed changes
- Sort by Name and Start Date

 

 

alex
11 - Bolide

"It's not impossible.  I used to bull's-eye womp rats in my T-16 back home. They're not much bigger than two meters."

Spoiler
80.JPG

8.15.16 097.JPG
gnans19
11 - Bolide

Fun exercise to sharpen Join+Union combinations

 

Spoiler
80.png
MarqueeCrew
20 - Arcturus
20 - Arcturus

@ChristineB,

 

I must have been really slow.  I couldn't understand the issue with Bob.  Finally, I got it.  I looked at how @NicoleJohnson solved hers and took it another direction.  Her solution put light on the Bob issue.  I won't say which runs faster, but since this is a slow exercise I'll say that NJ won that battle.

 

Cheers,

Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
lminors
9 - Comet

Solution attached. Added a 'Joined the Darkside' flag so that we could keep Bob's records but filter the traitor out when we want current Jedi details (this was based on there being an End Date in the update log).

 

Spoiler
Jedi HR Data Prep WorkflowJedi HR Data Prep Workflow

Luke

Alteryx Certified Partner and Jedi HR Manager

a_anderson
5 - Atom

This was a fun challenge!

Spoiler
Challenge 80.PNG