8 Replies Latest reply: May 15, 2015 6:19 AM by marisya chizhikova

# current date minus 7 days

Hi all!

I am struggling with such expression (percentage of rate's changing between 7 days):

1- Avg(index_1)/Avg({1<date = {'current date minus 7 days'}>}index_1)

Could you help me!?

Thanks! Marina

• ###### Re: current date minus 7 days

1- Avg(index_1)/Avg({1<date = {"\$(=today()-7)"}>}index_1)

It's possible you need to set the date format too. If the date format of your date field is MM/DD/YYYY then you can try:

1- Avg(index_1)/Avg({1<date = {"\$(=date(today()-7,'MM/DD/YYYY'))"}>}index_1)

• ###### Re: current date minus 7 days

O, thanks a lot, and how to transform this expression if  I need "current by selected date - 7", not exactly "today")) .

• ###### Re: current date minus 7 days

date={"\$(=max(date)-7)"}

• ###### Re: current date minus 7 days

Still, it is more reliable with date():

date={"\$(=date(max(date)-7))"}

• ###### Re: current date minus 7 days

Set vSelDateMinus7 =date(max(date)-7)

1- Avg(index_1)/Avg({1<date = {'\$(vSelDateMinus7 )'}>}index_1)

• ###### Re: current date minus 7 days

all these expressions doesnt work (  I try to use it in text box..

even     Avg({1<date = {"\$(= makedate(2015,4,30))"}>}index_1) doesnt show anything

What have I missed?

• ###### Re: current date minus 7 days

Looks fine...  Are the field names correct?  What if you use this:

avg({1<date = {'30/04/2015'}>}index_1)

(I assume that your date format is DD/MM/YYYY.  Make corrections in the set if it is different)

• ###### Re: current date minus 7 days

Thank u very much!!! Ive done it!!  there was a problem with data format~!