# Qlik Sense Deployment & Management

Contributor III

## Difference between two dates

Hello ,

I have two fields and i would like to have the difference between them :

The two fileds are timestamp

and I need to have condition the difference is > 30 minutes

Thanks

1 Solution

Accepted Solutions

## Re: Difference between two dates

Hi,

try

if(num(num#(interval(Field2-Field1,'mm'),'###'))>30,'Hello', 'No')

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
11 Replies
Honored Contributor II

## Re: Difference between two dates

interval(field1-field2,'mm')

use this in any condition like if (interval(field1-field2,'mm') >30 , eepression1, expression2)

Learning never stops.

## Re: Difference between two dates

To find difference between two timestamp use

interval()

try like

interval(dateField1-dateField2,'mm')

Regards,

Prashant Sangle

Great dreamer's dreams never fulfilled, they are always transcended.
Contributor III

## Re: Difference between two dates

Hello ,

interval(Filed 2 - Field 1,'mm:ss')

Thanks for all

Contributor III

## Re: Difference between two dates

I use this for the condition but it doesn't work :

if (interval(field1-field2,'mm') >30 , eepression1, expression2)

Honored Contributor II

## Re: Difference between two dates

where exactly are you using this? and if you need only minutes why using mm:ss?

Learning never stops.
Contributor III

## Re: Difference between two dates

yes yes I delete the ss and i tryed

if ( interval(field1-field2,'mm') >30 , eepression1, expression2)

it doesn't work

## Re: Difference between two dates

Hi,

use if(num(num#( interval(field1-field2,'mm') >30)),epression1, expression2)

interval() is formatting function it wont convert actual data.

Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Contributor III

## Re: Difference between two dates

Hello Preshant,

I used this :

if(num(num#( interval(Field2-Field1,'mm') >30)),'Hello', 'No') and this is the result :

the value is 189 > 30 and it display 'No '

## Re: Difference between two dates

Hi,

try

if(num(num#(interval(Field2-Field1,'mm'),'###'))>30,'Hello', 'No')

Regards

Great dreamer's dreams never fulfilled, they are always transcended.