Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

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
MVP
MVP

Re: Substracting two Dates

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

Re: Substracting two Dates

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 ??

MVP
MVP

Re: Substracting two Dates

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.

MVP
MVP

Re: Substracting two Dates

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

Re: Substracting two Dates

chart dimension is insurer.

I have 7 insurer.

Not applicable

Re: Substracting two Dates

hi try this

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

Community Browser