6 Replies Latest reply on Jul 27, 2017 8:55 AM by mariam.ah

# Previous Period for last year

Hi all,

i could calculate the value of sales  from  2 parametre date  : start date and end date

Date range:

[Date order]>=[start date ] and [Date order ]<=[end date]

current periode

IF [Date range ]= TRUE then [sales] END

and it works but my need is to calculate the same period for last year

for example : start date :01/02/207 and  end date : 05/10/2017  sales for current periode is 10000

i need to calculate the value of sales in the last year betwenn 01/02/2016 and 05/10/2016

• ###### 1. Re: Previous Period for last year

Hi Mariam,

DATEADD("year", -1, [start date]) will give you the previous year of your parameter.

Good luck!

Wim

• ###### 2. Re: Previous Period for last year

Hi ,

I dont need last year , i need the same period For last year , As I explained above

• ###### 3. Re: Previous Period for last year

He is actually right ... why can't you use:

[Date order]>=[start date new] and [Date order ]<=[end date new]

where start date new is what Wim proposed ..

• ###### 4. Re: Previous Period for last year

Hi Mariam,

By doing as Will said, you'll get the start date of the previous year, you have to do the same for the end date of previous year. And so by doing a calculated field Previous Year:

[Date Order] >= DATEADD("year", -1, [start date]) AND [Date Order] <= DATEADD("year", -1, [end date])

You'll get orders of the same range for previous year.

If you want the sum of sales for previous year, same range:

SUM(IIF( [Previous Year], [Sales], 0))

Vincent

• ###### 5. Re: Previous Period for last year

Okey, it works correctly

Thank you

• ###### 6. Re: Previous Period for last year

ok sir, thank you !