cancel
Showing results for 
Search instead for 
Did you mean: 
Announcement | Welcome to Alteryx Academy! We hope you enjoy the journey. Let us know how we can improve your learning experience by completing this survey.
Do you have the skills to make it to the top? Subscribe to our weekly challenges. Try your best to solve the problem, share your solution, and see how others tackled the same problem. We share our answer too.
Weekly Challenge
Do you have the skills to make it to the top? Subscribe to our weekly challenges. Try your best to solve the problem, share your solution, and see how others tackled the same problem. We share our answer too.

Challenge #80: Slowly Changing Dimensions

Alteryx
Alteryx

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!

 

 

 

 

 

 

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

 

89feed0a704a9706f4924c5f831a2d23.jpg

 

 

Spoiler
WeeklyChallenge80.JPG

 

nick_ceneviva
Alteryx Certified Partner

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
Spoiler
I was able to use a couple joins and formula tools along with a union.
Capture.PNG
Quasar
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
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
Alteryx Certified Partner

Fun exercise to sharpen Join+Union combinations

 

Spoiler
80.png
Alteryx Certified Partner
Alteryx Certified Partner

@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


===> https://community.alteryx.com/t5/Engine-Works-Blog/SANTALYTICS-2017/ba-p/93770 <===
Chaos reigns within. Repent, reflect and reboot. Order shall return.
lminors
Alteryx Certified Partner

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

This was a fun challenge!

Spoiler
Challenge 80.PNG