# 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 #146: SANTALYTICS 2018 - Part 2

Highlighted
8 - Asteroid

My solution attached, with \$380 (19 solutions so far) to spend. I also filtered out the list to just the items that A Precious Child accept. Had \$1 left over at the end of it!

Spoiler
Highlighted
8 - Asteroid

Here is my solution...

Spoiler

I went with the lowest price first with the maximum number of items (up to 10) by category...

Scanned all the pages to come up with the number of solutions (minus the files of the original post of this thread) and added my solution to the count...

Highlighted
7 - Meteor

Found this quite tricky so definitely not the best!

I had \$420 to work with.

Highlighted
8 - Asteroid

Fun challenge.

I had a flashback to my excel days, writing a nested formula in the multi-row formulas reminded me of some old nasty excel formulas.   I'm curious to see the other approaches.

I prioritized on % savings vs. MSRP (trying to get the biggest bang for the buck).  Then I bought up to 10 for each product. Although, I'm very skeptical the Dove Beauty Bar is normally priced \$82.56.

Spoiler

Highlighted
8 - Asteroid

Sorry to be a Scrooge, but the scraping macro is also picking up extra counts -- including the opening post and saved images containing yxmd & yxzp.

I'm still going to use the macro in my solution to make the donation greater

I also used a different approach for the page count, scraping once for the page count and urls, then a 2nd download to go to each page url.

Merry Christmas and Happy Holidays to all..thanks!

Highlighted
Alteryx

Spoiler

Hello everyone,

For my solution, I utilized the "solutions counter" macro that was provided, but tweaked it so that it would run for the number of pages in the thread rather than the default 10 that was set in the macro. It looks for the HTML string "lia-paging-page-last lia-js-data-pageNum-" which is followed by the number of the last page number. This is then fed in as a control parameter which updates the generate rows tool tool in the "solution counter" macro. I thought that this would be useful if enough responses are received to bump the number of pages over 10.

Budget is then calculated and split in half to be allocated to clothing and hygeine.

I figured that looking at the % Savings from MSRP to sale price would potentially be an indicator of good deals so I have the data sorted with the highest discounts first. Some retailers intentionally set their MSRP higher to give the impression of better deals so this may not be the best criteria, but product priority can easily be changed by adjusting the sort tool to use the desired criteria.

I used a generate rows tool to create 10 rows for every product so that this would be the maximum allowed for purchase in order to get some diversity in the products purchased. Then I used a running total tool on the sale price and a filter where the running total is less than or equal to the budget for each category. After the items have been identified, a summarize tool is used to total the quantities.

At this point, I realized that there was still budget left over. It wasn't much, but more products needed to be purchased to spend the rest. I then used the same process as described previously, but sorted the products from the lowest price to use the rest of the money.

This data was then unioned so the amount donated, budgets, and product list could all be viewed in the results container.

Highlighted
Alteryx Certified Partner

Joe Lipski - Alteryx â’¶â’¸â’º
Javelin Group
Highlighted
Alteryx Certified Partner
Spoiler

Made an additional basic macro that filters products based on ratings, reviews, for children, and products that mention kids or children in the description!

then maximized available products with a simple running total tool!

Happy Holidays!

CO

Highlighted
Alteryx Community Team

@BPurcell - The macro is intentionally lax, but good eye!

Highlighted
8 - Asteroid
Spoiler
WorkflowShopping ListCategory Check