Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
riishabhz
Contributor

shelf life

i have two columns of date 

a                                 b

13/7/2017           13/7/2018

i want to show shelf life as b-a = 365 

what should i do?

1 Solution

Accepted Solutions

Re: shelf life

use
interval(b-a,'D')

Regards,
Great dreamer's dreams never fulfilled, they are always transcended.

View solution in original post

6 Replies
Frank_Hartmann
Honored Contributor II

Re: shelf life

1:
LOAD * INLINE [
a, b
13/7/2017, 13/7/2018
];

NoConcatenate
2:
Load *, date#(b,'DD/MM/YYYY')-date#(a,'DD/MM/YYYY') as shelf Resident 1; DROP table 1;

Re: shelf life

use
interval(b-a,'D')

Regards,
Great dreamer's dreams never fulfilled, they are always transcended.

View solution in original post

riishabhz
Contributor

Re: shelf life

   
   
24-06-201724-06-201830/12/1900

 

interval(date#(B,'DD-MM-YYYY')-date#(A,'DD-MM-YYYY'),'D')

i tried your solution but now its not showing me as 365 output in 3rd column.

 

Re: shelf life

provided solution must work. can you describe what are the steps you are trying? where are you trying?

post your script and chart expression

 

Regards,

Prashant Sangle

Great dreamer's dreams never fulfilled, they are always transcended.
MVP
MVP

Re: shelf life

Remove the date format for the result column. 30/12/1900 is the date representation of the number 365.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
riishabhz
Contributor

Re: shelf life

yes it worked thanx