Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

QSense
Contributor 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

Tags (1)
9 Replies
MVP
MVP

Re: Calculate quantity of days

=ISTEK_ACISTARIHI2 - weekstart(ISTEK_ACISTARIHI2)

gandalfgray
Valued Contributor

Re: Calculate quantity of days

=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
Contributor II

Re: Calculate quantity of days

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
Contributor II

Re: Calculate quantity of days

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

MVP
MVP

Re: Calculate quantity of days

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
Contributor II

Re: Calculate quantity of days

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
Contributor II

Re: Calculate quantity of days

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

MVP
MVP

Re: Calculate quantity of days

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
Contributor II

Re: Calculate quantity of days

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

Community Browser