Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

manigunta
Contributor

How to get no of days days between two timestamp columns

Hi

How to get no of days days between two columns

data is in below format in both columns

1899-12-31 00:00:00:0

thanks

1 Solution

Accepted Solutions
d_prashanthredd
Contributor III

Re: How to get no of days days between two timestamp columns

Can you provide your sample data or app?

15 Replies

Re: How to get no of days days between two timestamp columns

floor(date1-date2) will give you difference in days

Regards,

Prashant

Regards,
Prashant Sangle

Re: How to get no of days days between two timestamp columns

You can use interval()

try like

Interval(date1-date2,'D')

Regards

Regards,
Prashant Sangle
techvarun
Valued Contributor II

Re: How to get no of days days between two timestamp columns

d_prashanthredd
Contributor III

Re: How to get no of days days between two timestamp columns

Hi Nagamani,

I think, straight away you can do (Date2-Date1) if both the columns are having same date format.

d_prashanthredd
Contributor III

Re: How to get no of days days between two timestamp columns

That all depends on how you want to represent the difference i.e in Days or Hours

manigunta
Contributor

Re: How to get no of days days between two timestamp columns

it is not giving correct values, tried as below

manigunta
Contributor

Re: How to get no of days days between two timestamp columns

this is gving wrong values when tried below

Interval(date1-date2,'D')

manigunta
Contributor

Re: How to get no of days days between two timestamp columns

when trying to do d1-d2 it is giving some abnormal value as below, can you please help on this

d_prashanthredd
Contributor III

Re: How to get no of days days between two timestamp columns

try this..

=Ceil(Interval(Date(Date1, 'MM/DD/YYYY hh:mm:ss') - Date(Date2, 'MM/DD/YYYY hh:mm:ss'), 'DD' ))

Community Browser