Weekly Challenge

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

We're actively looking for ideas on how to improve Weekly Challenges and would love to hear what you think!

Submit Feedback
We've recently made an accessibility improvement to the community and therefore posts without any content are no longer allowed. Please use the spoiler feature or add a short message in the message body in order to submit your weekly challenge.

Challenge #192: Crane Leasing

Highlighted
8 - Asteroid

First time using generate rows to fill Date data. Useful challenge. 

 

Spoiler
Zenon_0-1575403288429.png

(I also just now learned you can paste screenshots directly into the text editor, so no more saving pictures of my workflows for me!)

Highlighted
8 - Asteroid

Solved!

 

Spoiler
Capture.PNG
Highlighted
Alteryx Partner

Apparently reading the instructions is useful! At least I found two completely different methods of doing this!

 

Spoiler
Workflow.png
Highlighted
8 - Asteroid
 
Highlighted
7 - Meteor

Attached is my solution

Highlighted
8 - Asteroid

Challenge #192 solved!

 

Spoiler
nivi_s_0-1575408865662.png
Highlighted
8 - Asteroid

Hi! Here my solution  

Highlighted
Alteryx Partner

I'm guessing there are more efficIient ways to do this, but it works

 

Now that I have reviewed other, more elegant, solutions, I am embarrassed at the complexity of my response.  I was somewhat on the right track, but missed a couple of processes that would have made this much simpler....

 

Spoiler
It doesn't feel right that I had to duplicate the process for the two different cranes.  Otherwise this doesn't seem too bad.

Process:
- Convert StartDate and End Date to date format
- Split into two duplicate threads, one for Tiny Tim and one for Maximus
- Filter data for status = "Leased" as if it is not leased we don't care why
- Generate rows for the 3 years of interest
- Join with data on Date and EndDate
- Union Left Join and Join to ensure all dates are captured
- Join with data on Date and StartDate
- Union Left Join and Join to ensure all dates are captured
- Initialise 1 Jan 2016 status for Tiny Tim as Leased and for Maximus as Not Leased
- Set Crane Name as either Tiny Tim or Maximus for all dates for the respective threads
- Multi-Row set Status as Leased or Not Leased depending on the presence or non-presence of Start Date (on current row) or End Date (on prior row), else = status of prior row
- Create a "Both" field where both cranes are leased (1) or not both leased (0)
- Sum of Both field

MySolution.PNG

 

 

Highlighted
5 - Atom
Spoiler
martybutchman_0-1575451671837.png
Alteryx Partner

Nice challenge! Attached my solution below