Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

pavansonu99
New Contributor III

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
Honored Contributor II

Re: Difference of two dates

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

give a try with below:

TranDateNum - Above( Only(TranDateNum) )

pavansonu99
New Contributor III

Re: Difference of two dates

Hello Andrea,

i am sure there is only one TranDateNum .


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


thanks for your replay

Re: Difference of two dates

Try this as well might be it should worked

=TranDateNum - DATE( Above(TranDateNum) )


Or


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


pavansonu99
New Contributor III

Re: Difference of two dates

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.

Re: Difference of two dates

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
New Contributor III

Re: Difference of two dates

in above picture Trandate is already in date format

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

agigliotti
Honored Contributor II

Re: Difference of two dates

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

pavansonu99
New Contributor III

Re: Difference of two dates

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


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

Re: Difference of two dates

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

Community Browser