Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
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
MVP
MVP

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

give a try with below:

TranDateNum - Above( Only(TranDateNum) )

The Power of shining a light on the dark side of your data.
Follow me on my LinkedIn | Know Gamma Informatica at gammainformatica.it
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
Champion III
Champion III

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
Champion III
Champion III

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

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

The Power of shining a light on the dark side of your data.
Follow me on my LinkedIn | Know Gamma Informatica at gammainformatica.it
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
Champion III
Champion III

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