3 Replies Latest reply on Mar 30, 2018 1:04 PM by Vinnie Ahuja

# Help Creating Table For Product Sold In Last 14 Days, but not in past 3 Days

So I have a set of data that is essentially sales data for specific products.   What I'd like to see is some sort of way to analyze what products we've sold within the past 2 weeks, but have not been sold within the past 3 days.    My data essentially looks like this:

DateProductQuantity Sold
10/1/2017Apples12
10/2/2017Peaches14
10/3/2017Apples5
10/4/2017Pears18
10/5/2017Apples1
10/6/2017Apples0
10/7/2017Apples32
10/8/2017Kiwis2
10/9/2017Apples22
10/10/2017Apples3
10/11/2017Apples0
10/12/2017Apples0
10/13/2017Apples0
10/14/2017Apples0
10/15/2017Oranges1
10/16/2017Apples0

In this case I'd would want to create a representation that showed I hadn't sold any kiwis, apples, or pears in the past 3 days.   Any ideas on how to pull this off would be great.

Best,

Ethan

• ###### 1. Re: Help Creating Table For Product Sold In Last 14 Days, but not in past 3 Days

Hi Ethan,

Here are a couple calculations that I think may help you.  The crux of what you're looking for I think is answered by using Level of Detail calculations.

Sales in the last 3 Days:

{FIXED [Product]: sum(if(DATEDIFF('day', [Date], today())) <= 3 then [Quantity Sold] else 0 end)}

Sales in the last 14 days:

{FIXED [Product]: sum(if(DATEDIFF('day', [Date], today())) <= 14 then [Quantity Sold] else 0 end)}

You could see total sales, 14-day sales, and 3-day sales concurrently:

Hope this helps!

Cheers

Vinnie

1 of 1 people found this helpful
• ###### 2. Re: Help Creating Table For Product Sold In Last 14 Days, but not in past 3 Days

Thanks Vinnie.   I knew it had be something like that, but wasn't really finding any documentation on putting it all together like that.

Best,

Ethan