9 Replies Latest reply: Nov 22, 2012 1:57 AM by Syed Khaled Shahbaaz

# calculate days between two dates

Hello ,

I have a dimension called weekstart as you see below in list

I want to calculate how many days there are between the first dayof weekstart and creation date

I just wrote the expression min(date(WeekStart(ISTEK_ACISTARIHI2),'DD.MM.YYYY'))-date(ISTEK_ACISTARIHI2,'DD.MM.YYYY') ti

Creation date =ISTEK_ACISTARIHI2

Actually I want to calculate whether gap between  the first dayof weekstart and creation date is more than 30 days or much

It means weekstart-creation date >=30

 ID Creation Date weekstart 1 07.10.2011 11:43.44 05.11.2012 2 01.10.2012 15:53.55 12.11.2012 3 08.11.2012 15:55.52 19.11.2012
• ###### Re: calculate days between two dates

Does if(weekstart-[Creation Date]>=30,.....) not work for you ?

You may need to wrap each date up in a Num() function.

Jonathan

• ###### Re: calculate days between two dates

It does not work

• ###### Re: calculate days between two dates

Hi,

You can try something like this:

=Interval(date(Weekstart)-date(Creation Date),'DD')

Hope that helps.

Regards,

-Khaled.

• ###### Re: calculate days between two dates

It didnt work

• ###### Re: calculate days between two dates

What I want to do is that as you see below a field Açılış Tarihi=ISTEK_ACISTARIHI2

and durum= ISTEK_DURUM

I have created dimension calculates weekstart =date(WeekStart(ISTEK_ACISTARIHI2),'DD.MM.YYYY')

and created two expression one of them is count of ISTEK_DURUM='Açık' other expression calculates

gap between weekstart and ISTEK_ACISTARIHI2 more than 30 days and ISTEK_DURUM='Açık'

What I want to do in expression 2 is how many days passed away from each weekstart

• ###### Re: calculate days between two dates

Hi,

Have you tried using:

=if(Interval(date(Weekstart)-date(Creation Date),'DD')>30,'WeekStart More Than 30 Days','Less Than 30 Days')

Hope that helps.

- Khaled.

• ###### Re: calculate days between two dates

Hi

PFA