Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
riishabhz
Creator
Creator

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
PrashantSangle

use
interval(b-a,'D')

Regards,
Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂

View solution in original post

6 Replies
Frank_Hartmann
Master II
Master II

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;

PrashantSangle

use
interval(b-a,'D')

Regards,
Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
riishabhz
Creator
Creator
Author

   
   
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.

 

PrashantSangle

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.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
jonathandienst
Partner - Champion III
Partner - Champion III

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
Creator
Creator
Author

yes it worked thanx