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 #192: Crane Leasing

ZenonH
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!)

jmt214
8 - Asteroid

Solved!

 

Spoiler
Capture.PNG
kapratt
5 - Atom

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

 

Spoiler
Workflow.png
benbenjoy
8 - Asteroid
 
abrouwer
8 - Asteroid

Attached is my solution

nivi_s
8 - Asteroid

Challenge #192 solved!

 

Spoiler
nivi_s_0-1575408865662.png
RichoBsJ
11 - Bolide

Hi! Here my solution 🙂 

🙂

SueDonim
8 - Asteroid

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

 

 

martybutchman
5 - Atom
Spoiler
martybutchman_0-1575451671837.png
nataliamiteva
8 - Asteroid

Nice challenge! Attached my solution below 🙂