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.
We are updating the requirements for Community registration. As of 7/21/21 all users will be required to register a phone number with their My Alteryx accounts. If you have already registered, you will be prompted on your next login to add your phone number.

Weekly Challenge

Solve the challenge, share your solution and summit the ranks of our Community!

Also available in | Français | Português | Español | 日本語
IDEAS WANTED

We're actively looking for ideas on how to improve Weekly Challenges and would love to hear what you think!

Submit Feedback

Challenge #139: Spooky API Connection

JoeM
Alteryx Alumni (Retired)

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!

 cand.gif

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

patrick_digan
16 - Nebula
16 - Nebula
Spoiler
@JoeM My solution assumes that Atomic Fireballs = Atmoic Fireballs. I've never tried the latter.
At 2,500 calories a day, it looks like I could be sustained for almost 2 weeks.

Capture.PNG
cgoodman3
12 - Quasar
12 - Quasar

Spent too long parsing the json data out.

Spoiler
challenge_139.JPG
Chris
Check out my collaboration with fellow ACE Joshua Burkhow at AlterTricks.com
cgoodman3
12 - Quasar
12 - Quasar

I get the same answer as @patrick_digan if I amend the spelling to Atomic Fireballs.

Chris
Check out my collaboration with fellow ACE Joshua Burkhow at AlterTricks.com
kcgreen
8 - Asteroid

My answer doesn't match the given solution but I get the same as Patrick_Digin.

 

Spoiler

 

I also made the assumption that Atmoic Fireballs were the same as Atomic Fireballs 

 

api2.JPG

 

 

 

augustj
5 - Atom

I feel like I may have some extra steps but I came up with the same answer.

JoeM
Alteryx Alumni (Retired)

The fat-fingered data entry accounts for our dependencies! Thanks @patrick_digan for always keeping me on the straight and narrow!  The start file has been updated.

 

kat
12 - Quasar

 candy.gif

 

 

Spoiler
I got a slightly different calorie count as I took into account the pieces that made up the 100g of candy, instead of assuming that the given quantity was in increments of 100g.
Really cool idea for a challenge!


Challenge #139.PNG

 

jasperlch
12 - Quasar

Solution attached

JEBS
6 - Meteoroid

My solution assumes that Atmoic Fireballs =!  Atomic Fireballs

 

BR

Jeppe