Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Difference between two days

I have a table which contain two coloumn.

Let the first Coloumn is Date and second Column is Value.

where, value = (Today() - Date)

It shown like:----

Date                               Value

18/04/11                          99

18/04/11                          100

10/09/11                          155

10/09/11                          139

10/09/11                          136

I use the date format as DD/MM/YYYY

It's not shown the correct value. Please help me!!!!!!!

17 Replies
Not applicable
Author

Hi Anup,

The format must be same for both the Date and Today()

value = (Date(Today(),'DD.MM.YYY') - Date(Date,'DD.MM.YYYY')

Hope that helps

its_anandrjs

Hi,

Make proper date format for this like

Date( DateField, ' DD/MM/YYYY ' ) as Date

HTH

Rgds

Anand

its_anandrjs

Hi,

For

Date use

Date = Date( DateField, ' DD/MM/YYYY ' )

Value use

value = ( Date( Today(),'DD/MM/YYYY' ) - Date( Date,'DD/MM/YYYY' )

Let me know about this.

Rgds

Anand

its_anandrjs

Hi,

Hope you got correct answer, if so mark it correct answer onmy post.

Let me know abt this.

Rgds

Anand

Not applicable
Author

No anand it's not working

It's till shown---

date          value     

02/04/11      26

02/04/11      17

02/04/11      13

02/04/11      14

02/04/11       23

I use pivot table.

SunilChauhan
Champion
Champion

it might be timestamp issue

please subtract two timestamp values and then see the result.

Sunil Chauhan
its_anandrjs

Hi,

Check your date format in SET command

SET DateFormat='M/D/YYYY';

Check this in your load script what is written there or other wise

use Date#( ) command to make dates

Rgds

Anand

Not applicable
Author

Hi

Sunil,

What is timestamp issue. I don't know actually. Please tell me the detail about that.

SunilChauhan
Champion
Champion

actually timestamp is a format where date contain time also with date

like

12/01/2011 23:45

may be your two difference below is due to time stamp

18/04/11                          99

18/04/11                          100

Sunil Chauhan