# Beastmode- Use date range as a calculation

π‘

We are a restaurant company and like to look at "Items sold per day Calculation".

It is a pretty straightforward beastmode to get that. (Total Quantity) / (Count distinct date of business * count distinct stores).

However, if the item does not sell in a day then it is not accounted for.Β

Example, we sell 4 of 'Product A' on Day 1, 0 of Product A on Day 2. The calculation would show the item sold per day as 4 rather than 2.

Β

A couple of thoughts I've had but wont work. Cross joining our items table to dateofbusiness/stores so 0's can be accounted for.... won't work, dataset is already HUGE

Using a max(dateofbusiness)-min(dateofbusiness) to get the number of days. Again, may be closer but still not ideal.

Β

The ideal solution would be to have a denomitor that equals "Number of Days being Analyzed" that works with the date range.

Tagged:
1

#### Β· Last Updated January 2021

• Have you deteremined a good way to calculate this? We are also looking towards a similiar issue. I would rather not "hard code" or force concrete date ranges

• π‘

I have not come up with a solution. Was hoping this thread could get some "likes" to have DOMO look into it.

• βͺοΈ

Having the exact same issue. Looking for average over all days, but only returning average based on days that have activity.

• Budapest / Portland, OR π€
Jae Wilson
Check out my π₯ Domo Training YouTube Channel π¨βπ»

**Say "Thanks" by clicking the β€οΈ in the post that helped you.
**Please mark the post that solves your problem by clicking on "Accept as Solution"
This discussion has been closed.