This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
Oh cool. Looks like a pretty soft launch. Take some numbers, divide, and round down. I should be able to do this in a single formula tool. Then, a summarize tool will take care of the total.
How do we lop off the decimal? Don't want to round, so I rely on the handy FLOOR function. This is a favorite. Basically cuts off the decimal altogether.
Since it's midnight on a Saturday, I'm hoping that it won't take long to solve. And it doesn't. Sub 2 minutes. Patting myself on the back, I foolishly think that I may be on the general leaderboard. Nope. Over 100 people solved before I did. Wow. So how did I track against Alteryx users? #2. Pretty happy with that!! But soon realize that this whole process will be, in no way, me trying to get on the leaderboard. I'm happy with completing the days, and sharing my thoughts and processes along the way.
Please join in with me!
Now on to part 2.....
We learn that fuel requires fuel, so we have to keep doing the formula above until we hit zero or a negative number. Getting loopy!! It's time to make this a macro. I chose an iterative macro in order to loop through each number until it's low enough. The macro itself is super simple. Same exact formula. Check if the result is zero or less, and iterate if it isn't. Write out everything to the output, but iterate only on the reduced number.
Took another 2-3 minutes to build this macro. Very fast run time.
My solution for day 1 was basically the same as @estherb47's.
I really liked @patrick_digan's solution, though, because Generate Rows is a rarely-used tool for me. My mind went directly to an iterative macro, so I wouldn't have thought to use Generate Rows to iterate until a condition is met (which is exactly what it does!)