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: 
Not applicable

Substracting two Dates

Hi,

I want to substract two dates. And the output should be Number of Days.

I want to display it in a bar graph against dimension.

I used this as my expression

=interval(DateSent-DateReceived,'DD')

But i am getting No data to display.

It shows only when i select any field.

Help me with this.

Thanks and Regards

Keerthi

6 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

To get the date difference in days, just subtract the first date from the second.

=DateSent-DateReceived

You could round this with Round(), Floor() or Ceil() according to your requirements.

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

I am getting substracted date only when i select date received.

it should be displayed against a dimension in a chart.

How to do that ??

jagan
Luminary Alumni
Luminary Alumni

Hi,

If there are multiple records for the dimension then you don't get data, try using

=Ceil(Max(DateSent)-Max(DateReceived))


Hope it helps you.


Regards,

Jagan.

jonathandienst
Partner - Champion III
Partner - Champion III

What is the chart dimension? If the dates are not distinct per dimension line, you will to apply an aggregation function like Min() or Max().

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

chart dimension is insurer.

I have 7 insurer.

Not applicable
Author

hi try this

=interval(num(DateSent)-num(DateReceived),'DD')