We're actively looking for ideas on how to improve Weekly Challenges and would love to hear what you think!Submit Feedback
Here is my solution...
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...
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.
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!
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.
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!