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.
I think I've used the generate row tool more times this contest then I've ever used it before. Went with a brute force approach. Used generate rows to create every possible position and then calculated the fuel cost. Sorted for the min fuel cost per possible position.
Nicole's pro tip for today: Pay attention to the field length in your initial data input. 254 characters is not enough, and you will waste 10 minutes questioning everything you ever knew about Alteryx before realizing this. #AskMeHowIKnowThis
Oh why is there not a factorial function in the formula tool? I initially created the generate rows to get the factorial after my calculation of fuel = abs ( start position - end position ), however this was too slow as it just explodes the data unnecessarily. So moved it earlier in the workflow and then joined on only the required values.
Also got to use my input macro! But I didn't wake at 5am so lost out on the speed points!
edit: I’ve just realised we are not solving a factorial in part two as n! = n*(n-1)! And we are adding consecutive values not multiplying. Well at least I was doing the right thing in my solution just calling it the wrong thing!
Chris Check out my collaboration with fellow ACE Joshua Burkhow at AlterTricks.com
Dang! I like how @NicoleJohnson used running total, as you've already generated all the numbers i.e. you've calculated the abs(position - new position) via the generate rows so you just need to apply the running total to get the equivalent of the factorial.
Plus how @bflick just evaluated it as abs(position - new position) * (abs(position - new position)+1)/2
I need to read the directions more carefully - I put in the position instead of the fuel amount and couldn't figure out my "mistake" for 30 minutes 😩In hindsight I probably didn't need the batch macro.