4 Replies Latest reply on Oct 12, 2018 2:49 AM by Alex Martino

# How to subtract dates to first date with data

I have a number of products with sales data over a 30 day period. I want to find the number of days in that period FROM the date where the data was above 0. So if September 9th was the first date of >0 for a product, I want to return the difference between that and the end date. How can I do this?

See tab "last 30 days"

• ###### 1. Re: How to subtract dates to first date with data

Anyone?

• ###### 2. Re: How to subtract dates to first date with data

Lei Chen can you help with this one as well? Similar type question....

• ###### 3. Re: How to subtract dates to first date with data

Try below calculation see if this help

(IF sum([Sales Volume])>0 and LAST()=0 THEN max([Date]) ELSE NULL end)

-(IF sum([Sales Volume])>0 and  first()=0 THEN MIN([Date]) ELSE NULL end)

• ###### 4. Re: How to subtract dates to first date with data

Hi Sera. That doesn't return anything. It doesn't find the first value above 0.

Look at the attached spreadsheet, first tab.