Hi All,
Here is my scenario...
I have 2 columns with product line and date
for ex
PL Date Days Difference
A 05-Jan-13 0
B 06-Jan-13 1
C 10-Jan-13 4
D 15-Jan-13 5
I need third columns as mentioned above.
Try this
running-difference ([Date])
Running-Difference is not working...
Running-difference needs a numeric value.
So, how do we turn a date field to a numeric field? There are several methods. Since you are particularly interested in the days difference, I'd go with the following:
_days_between ([Date],1900-01-01)
What this will do is return the number of days since January 1st 1900, a date on which I'm fairly certain you have no relevant data, and the date in the Date field.
So, you'll want to do something like this:
running-difference(_days_between ([Date],1900-01-01))
if FM model
try
select t.datedate,
lead(datedate) over(order by datedate) next_date,
lead(datedate) over(order by datedate) - datedate difference