Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
pavansonu99
Creator
Creator

Difference of two dates

Hi All,

WhatsApp Image 2017-09-25 at 20.52.04.jpeg

i want date differences. i have date as TranDateNum... i am calculating like  TranDateNum-above(TranDateNum) but i   failed to get the result

can please help what is the best expression here.


10 Replies
agigliotti
Partner - Champion
Partner - Champion

are you sure you have only one TranDateNum value for dimensions ?

give a try with below:

TranDateNum - Above( Only(TranDateNum) )

pavansonu99
Creator
Creator
Author

Hello Andrea,

i am sure there is only one TranDateNum .


TranDateNum - Above( Only( TranDateNum) )    --->   let me try with this.


thanks for your replay

its_anandrjs

Try this as well might be it should worked

=TranDateNum - DATE( Above(TranDateNum) )


Or


=INTERVAL( TranDateNum - DATE(Above(TranDateNum) ) ,'DD')


pavansonu99
Creator
Creator
Author

Hi Anand,

i  have a doubt TranDateNum in in Number format if i use DATE(Above(TranDateNum)) it will convert into date format.

how can i subtract num with date.

its_anandrjs

Ohh then convert first it into date format may help you change into your desired date format.

=Date(TranDateNum) - DATE( Above(TranDateNum) )


Or


=INTERVAL( Date(TranDateNum) - DATE(Above(TranDateNum) ) ,'DD')

pavansonu99
Creator
Creator
Author

in above picture Trandate is already in date format

in the above i am not able to get values for            Above(TranDatenum)

agigliotti
Partner - Champion
Partner - Champion

try change the expression in Above(TranDatenum) to see what you get for the first two rows.

pavansonu99
Creator
Creator
Author

for Above(TranDatenum) i am not getting any values.


i am not getting what is the problem . can you suggest me any solution.

its_anandrjs

Then why you write previous "TranDateNum in in Number format" please check format once.