Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
glcordell
Contributor II
Contributor II

Above function not working properly

I have a measure called Service.Service End Time. I want to get the previous record's Service.Service End Time and use it in an expression where I calculate the current row's Service.Service Start Time minus the previous records Service.Service End Time. I am getting partial results where sometimes it does the calculation and other times it returns nulls. The only times it works is when the previous Service.Service End Time and the current Service.Service Start Time are identical. The expression is:

=Interval(Time#([Service.Service Start Time], 'hh:mm TT')-Above(Time#([Service.Service End Time], 'hh:mm TT')), 'hh:mm')

I am calculating the gaps between appointments.

Thanks in advance.

Labels (1)
1 Reply
Steven_Haught
Creator III
Creator III

@glcordell 

You could try to do this on the front end in the script. Try something like this:

Newtable:
Load
*,
[Service.Service Start Time]-Previous([Service.Service End Time]) as TimeGap
;


Load
*
RESIDENT orginaltable
Order By YOURDIMENSION desc
;
DROP TABLE orginaltable;