Last week's solution can be found here!
Who's ready for halloween?
Ok, maybe the API isn't inherently spooky - it's one of the simpler ones out there! What is 'spooky' about it is understanding candy consumption of children this week!
For any parents out there, you might be wondering what the nutrition stats look like when your child dumps all his/her goodies out the pillow case and marks short work of the sweets. More often than not, the small distributed candies do not have nutritional facts to review. Alteryx to the rescue! Using USDA API, try to calculate how many calories we've collected in out bag.
1) Sign up for the USDA NDB API (sub 30 sec) https://ndb.nal.usda.gov/ndb/doc/index
2) Read up on the documentaion https://ndb.nal.usda.gov/ndb/doc/apilist/API-FOOD-REPORTV2.md
3) Using the Bag Data (Candy x Qty), lookup the NBD IDs and create ONE and only ONE request (use basic response type).
Hints for solution:
1) We only filtered 'nutrient.x.measures' out and just kept
2) Kcal is a calorie