Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
QSense
Creator II
Creator II

Calculate quantity of days

I have a dimension it shows weekstart dates such as 19.11.2012,12.11.2012,05.11.2012

=date(WeekStart(ISTEK_ACISTARIHI2),'DD.MM.YYYY')

here I want to calculate how many days between my dimension and ISTEK_ACISTARIHI2

ISTEK_ACISTARIHI2 format is DD.MM.YYYY hh:mm:ss

9 Replies
swuehl
MVP
MVP

=ISTEK_ACISTARIHI2 - weekstart(ISTEK_ACISTARIHI2)

gandalfgray
Specialist II
Specialist II

=ISTEK_ACISTARIHI2-WeekStart(ISTEK_ACISTARIHI2)

or

=Date(ISTEK_ACISTARIHI2,,'DD.MM.YYYY')-Date(WeekStart(ISTEK_ACISTARIHI2),'DD.MM.YYYY')

i think would do

/gg

QSense
Creator II
Creator II
Author

Hello I have a data it is updated on each date(WeekStart(ISTEK_ACISTARIHI2),'DD.MM.YYYY')

ı want to find how many days passed away from ISTEK_ACISTARIHI2

In other words when it is updated how many days over ISTEK_ACISTARIHI2

QSense
Creator II
Creator II
Author

19.11.2012AçıkDimension=date(WeekStart(ISTEK_ACISTARIHI2),'DD.MM.YYYY')
12.11.2012Açık
05.11.2012Kapalı
29.10.2012Açık
22.10.2012Kapalı
15.10.2012Açık
08.10.2012Açık
01.10.2012Açık

For instance lets assume that it is updated in 05.11.2012 my weekstartdate 19.11.2012

14 days passed away from when request is created

swuehl
MVP
MVP

Sorry, I haven't understood this. Could you post some lines of sample data together with your expected outcome?

If your only dimension is the one with the calculated weekstart and you have multiple ISTEK_ACISTARIHI2 dates that fall in one week, you probably need to aggregate your difference in days, maybe using avg() function:

=avg(ISTEK_ACISTARIHI2 - weekstart(ISTEK_ACISTARIHI2))

QSense
Creator II
Creator II
Author

ID Creation 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

For example update date is first day of weekstart When update is come I want to how many days passed over away from creation date

I can give example on update of 12.11.2012 how many days passed of ID 1 data's creating date from update date 12.11.2012

answer is 12.11.2012-07.10.2012= 35 days nearly

QSense
Creator II
Creator II
Author

weekstart = date(WeekStart(ISTEK_ACISTARIHI2),'DD.MM.YYYY')

swuehl
MVP
MVP

Sorry, how do you get to the update date 12.11.2012 for ID1 (I only see Creation date and a weekstart (that is calculated from another field?), both are different from 12.11.2012)?

QSense
Creator II
Creator II
Author

Hi,

Update date begining of weekstart

In example , The week of 05.11.2012(Weekstartday) update date is just beging day of this week  In other words

Week                    Update date

05.11.2012          05.11.2012

12.11.2012          12.11.2012