# Weekly Challenge

Solve the challenge, share your solution and summit the ranks of our Community!
New content is available in Academy! You may need to clear your browser cache for an optimal viewing experience

## Challenge #48: Calculating Distribution Priority

Highlighted
Asteroid

Highlighted
Asteroid
Spoiler
Two Out of Three Ain't Bad
Highlighted
Meteor

The spatial part was easy. The other stuff was a bit tricky.

Highlighted
Alteryx Partner

No pithy comments on this one - just pushing through

Spoiler
Process:
- Create objects for stores and warehouses from lat and long
- Append
- Calculate distance from each store to each warehouse
- Sort by store and distance
- Select closest warehouse to each store
- Join with warehouse supply (this shows what supply is possible to give to each store, given constraint)
- Sort retail demand by item (asc) and demand (desc)
- Join with warehouse and store data
- Sort data
- Multi-row tool to calculate amount available of each item after higher priority items filled
- Second multi-row tool was not needed, could have used formula tool but no harm no foul
- Calculate unmet demand
- Sort and select highest unmet demand
- Calculate amount filled for each item
- Sort and select most filled item
- Multiply miles by number of items filled
- Aggregate miles for each item
- Filter out those travelled more than 400,000 miles

Highlighted
Asteroid

My Effort

Spoiler
Alteryx
Spoiler
Highlighted
Meteoroid

after hours of trying

Highlighted
Asteroid
Spoiler
Highlighted
Alteryx

Leveraged Running Total and Multi-Row formulas.

Spoiler
Highlighted
Asteroid