community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcement | Get certified today - take the Alteryx Designer Core and Advanced exams on-demand now!
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.
Unable to display your progress at this time. Please try again a little later, or contact an administrator if you continue to see this error.

Challenge #146: SANTALYTICS 2018 - Part 2

Alteryx Certified Partner

Unfortunately I'm too late ... but a really interesting challenge.

Alteryx Certified Partner

Spent a while trying to crack the simple logic to this. Got it eventually.

 

Happy new year all.

 

Spoiler
1. Take cheapest option for each item category
2. Multiply out by 10 (max 10 of each item)
3. Order by price and calculate running total
4. Filter for within budget
Capture.JPG
Meteor

Bit late to the part on this one but here's my solution! Haven't done the Solution reading part...shortcut on that by using a text input (solution attached uses $600, which gives multiple purchases of clothing items, but works if this is changed)

My solution - finally! Was determined to figure out the Optimization tool. It has been my arch nemesis for some time now. After this challenge.... still my arch nemesis. :) But I got there eventually!!

 

 

Spoiler
WeeklyChallenge146.JPG

What a fun and Community-minded challenge... thanks to all who helped make a difference through both challenge completions AND personal contributions!! Just another example of how this Community is really making a difference in SO MANY WAYS. Love you guys. *tear* :)

 

Cheers!

NJ

 

Highlighted
Asteroid
Like me, feel previously defeated by this tool (probably for the same reasons) but pleased to have used it for a good cause on this challenge.
Alteryx Partner

What a great challenge to end the year.

 

I am rather new to Alteryx, and the interest really kicked in after attending Inspire in London last year, but on that conference, I had the great pleasure on attending a session held by the truly inspiring @NicoleJohnson

 

The topic was these weekly challenges, and that was what really got me kicked into this.

 

So I have tried to solve them ever since, but sometimes I got stuck, and they took a little more time than anticipated.

 

I did not manage to finish this in time, so my own solution did not count, but I did get my #SANTALYTICS 2018 badge, which I have put to use in this solution 😆

 

But before I present my solution, I also have to give a big shout-out to:

@JoeM for putting us up to this, and for his excellent live training on Prescriptive Optimization

@SydneyF for making the Tool Mastery | Optimization, that helped me understand this tool (and @JoeM's video)

@cgoodman3. for pointing out the optimization macro in the first place and of course

@NicoleJohnson, for just being so awesome (and provide solution that helps me go on, when I get stuck)

 

I have tried to put everything I have learned so far into this solution:

 

Spoiler
The first “requirement” I noticed was that the Community promised to donate $20 per solution between 12/17-12/21 with a $2,000 max, and we where allowed to count any yxmd/.yxzp attachment as a solution.

I did not use the provided Solution_Counter, but made my own as this macro

2019-01-16 10_33_01-Alteryx Designer x64 - Santalytics_Donations.yxmc.pngSantalytics MacroI wanted to make sure, that only solutions provided between 12/17-12/21 2018 was counted and only attachments of the given type, posted in that timeframe.
2019-01-16 10_33_53-Alteryx Designer x64 - challenge_146_solution_verakso.yxmd_.pngSantalytics Macro InputI made it as a macro, to keep it tidy, but also to easily change the parameters like
• Timeframe
• Donation per solution
• Max donations

Then I looked at the “requirements” on which items to buy for the donations. Here the major thing where:
Items should minimum have a 4 star rating, at least 10 reviews, and be in stock.
One other obvious “requirement” would be that the item have a sales price.

Also the items should be split into Clothes and Hygiene (the rest).

This was done by a straightforward filtering.

Standard Data Preperation
The come the optimization part. As mentioned, I was not aware of the Optimization Macro, so thanks again @cgoodman3 and @NicoleJohnson for bringing this to my attention.

I first started on the same path, as I can see many others did, by calculating all the items, and then use a running sum, to figure out, when the max amount was reached.

However, I was not pleased with this, since I always ended up with a rest.

So I took a deeper look at the Optimization macro, read the Tool Mastery page a couple of times (at least) watched @JoeM training video, and looked at the Samples installed with Alteryx (Help  Sample Workflows  Predictive Tool Samples  Prescriptive Analytics  1 Optimization Model Input Modes & 3 Optimization Fantasy Sports Lineup)

So in the end, I did manage to make use of this macro to optimize on price.

I did notice that @cgoodman3 used it to optimize on ratings, and @NicoleJohnson optimized on having one product from each category. And I have seen others optimizing in savings.

But I chose only price, and it seems to work surprisingly well, since I was able to spend every single dime of the donation.


One thing that did annoyed me tremendously was, that I was not able (smart enough) to only use the Optimization macro once, so instead of writing most of the same code twice, I encapsulated the Optimization macro in a another macro I then could use

2019-01-16 10_35_15-Alteryx Designer x64 - Shoppingcart_Optimizer.yxmc.pngOptimization macroI am rather confident, that a truly clever person would be able to prep the data and configure the Optimization macro, so you would not have to split it up and run it twice.

So my final workflow ended up. Looking like this:

2019-01-16 10_37_43-Alteryx Designer x64 - challenge_146_solution_verakso.yxmd_.pngComplete WorkflowGiven the parameters provided my first macro, counts that 43 solutions was provided in the given timeframe. The produces the amount of $860 to buy for.

There is 15 eligible items in the Clothing category and 751 in the Hygiene category to choose from, that meets the criteria.

With a 50/50 split on the amount that can be spend on each category; I end up with picking 7 different items from the Clothing category, and 11 from the Hygiene

2019-01-16 10_45_04-Alteryx Designer x64 - challenge_146_solution_verakso.yxmd.pngDistribution of the itemsMy shopping list, given the pre-requisites, is then looking like this

2019-01-16 10_47_25-Browse (70) - challenge_146_solution_verakso.yxmd.pngItem shopping listAs I have stated, then thanks to the Optimization macro, I ended up spending all the money donated.

You could always argue if the diversity of the products chosen could be better, since there is an overhead of products for men (38%) towards women (22%), but that was not taken into consideration here.

What a great puzzle, and I am looking forward to solve many more this year.


Best Regards
/Thomas

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Director, Customer Enablement
Director, Customer Enablement

@Verakso - thinks for such a detailed breakdown of how you approached the problem. Detailed descriptions like these are really important to us because it helps us understand how people can become successful in Alteryx. I think we found the secret. Everyone needs a @NicoleJohnson.

@Verakso, this might be one of the most thorough weekly challenge explanations I've ever seen - it is truly fantastic!! Examples like yours are SO incredibly helpful for the Community at large, and I am honored to be even mentioned - thank you so much for your kind words!! (You too, @JoeM - I am constantly in awe of this beautiful collaboration you & your team have helped to create that brings people like all of us together. THANK YOU!)

 

Keep charging down this path, Thomas! I can tell you have the enthusiasm and curiosity that will take you extremely far on your journey, especially with the skills it is so clear you have already in creating thoughtful, creative, organized solutions. You even chose the harder route, creating the solution counter on your own (and doing an excellent job of thinking through ALL the requirements, such as date filtering and creating versatility in the future with an app!), so that you could really learn and grow... and that makes all the difference. It is you who are the inspiration!! 

 

Cheers, and thank you for helping me start my day with such a warm smile!!  Gosh, I love you all. :)

NJ

Quasar

This was fun! A year ago I'd have never thought that I could build my own tool to scrape multiple pages of a website :)

Mine groups the downloads by user to not double count. I also tried to allocate the items fairly between the items by keeping the cheapest of each item.

Spoiler
Challenge #146 ploads.PNGbatch macro to scrape all pagesChallenge #146 page.PNGfind total page numbersChallenge #146 final.PNGFinal workflow
Alteryx Partner

Too bad it is too late to make a difference.  However this was good practice.  It would have been easy to shortcut and do the donation amount split manually, but I decided to link it all together. To choose quantities I decided to distribute the money evenly across the products in each category and rounded up the quantity so the actual purchase distribution was't exactly 50/50 but since it erred on the side of clothing I decided it was a good trade-off.

 

Spoiler
image.png