Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
QSense
Creator II
Creator II

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

IDCreation Dateweekstart
107.10.2011 11:43.4405.11.2012
201.10.2012 15:53.5512.11.2012
308.11.2012 15:55.5219.11.2012
1 Solution

Accepted Solutions
Anonymous
Not applicable

Hi

             PFA

View solution in original post

9 Replies
Anonymous
Not applicable

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

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

Jonathan

Not applicable

Hi,

You can try something like this:

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

Hope that helps.

Regards,

-Khaled.

QSense
Creator II
Creator II
Author

It does not work

QSense
Creator II
Creator II
Author

It didnt work

QSense
Creator II
Creator II
Author

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

     istek.png

Anonymous
Not applicable

Hi

             PFA

QSense
Creator II
Creator II
Author

thank you for reply

Anonymous
Not applicable

plz close d discussion if ur problem is solved by checking answered

Not applicable

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.