8 Replies Latest reply: Nov 20, 2012 7:42 AM by Arya v

# expression based on a Date Field

Hello ,

My below expression is based on today -30

but I want to based it on my dimension  =date(WeekStart(ISTEK_ACISTARIHI2),'DD.MM.YYYY')

İn shortly my dimension - 30 all ı want

=Count({<ISTEK_ACISTARIHI2 = {"<=\$(=Timestamp(Today() - 30, 'DD.MM.YYYY hh:mm:ss'))"},ISTEK_DURUM={'Açik'}>} ISTEK_ACISTARIHI2)

• ###### Re: expression based on a Date Field

Hi

if ur field is timestamp format then use

timestamp(timestamp#(urdimension)-30)

it is first convert timestamp filed into numbers and substract with 30 then

it convert it in to timestamp format

=Count({<ISTEK_ACISTARIHI2 = {"<=\$(=timestamp(timestamp#(urdimension)-30), 'DD.MM.YYYY hh:mm:ss'))"},ISTEK_DURUM={'Açik'}>} ISTEK_ACISTARIHI2)

• ###### Re: expression based on a Date Field

Unfortunately it didnt work

• ###### Re: expression based on a Date Field

Hi

what is this

ISTEK_ACISTARIHI2 format  give some  values for this

• ###### Re: expression based on a Date Field

Exactly What do you mean?

• ###### Re: expression based on a Date Field

Hi

it has another solution

i create one variable with expr like

vdays

=Timestamp(Timestamp#(PERIOD_END_DATE)-30)

and in expression

Sum({<PERIOD_END_DATE={">=\$(vdays)"}>}CR_AMOUNT)

it works for me

for u use the below expr

Sum({<ISTEK_ACISTARIHI2={">=\$(vdays)"},ISTEK_DURUM={'Açik'}>}metric)

• ###### Re: expression based on a Date Field

Where did you create variable in script side or in where

• ###### Re: expression based on a Date Field

I created variable but it does not satisfy date condition

for example 01.01.2012 selected ıt must get 30 days before data from this date but

it does not work in this way

• ###### Re: expression based on a Date Field

use date() insted of timestamp()

in th above exp

create variable in settings-variable overview

vdays

=date(date#(PERIOD_END_DATE)-30)

Sum({<ISTEK_ACISTARIHI2={">=\$(vdays)"},ISTEK_DURUM={'Açik'}>}metric)

ur field in date format

my exp in timestamp format

it work for me