AnsweredAssumed Answered

Duplicate Event Frames Error using ft_InterpolateRange

Question asked by mfarrow on Mar 6, 2017
Latest reply on Mar 13, 2017 by mfarrow

I am trying to query the AF to pull data from two event frames that share the same name on the same asset, but have different time ranges:

EQUILIBRATION7/2/2016 6:43:40 AM7/2/2016 7:31:53 AM
EQUILIBRATION7/2/2016 11:34:58 AM7/2/2016 12:22:55 PM

When I run a query to pull data from these two EFs it returns the "Index was out of range. Must be non-negative and less than the size of the collection.  Parameter name: index" error message.  This only appears to happen on these "duplicate" event frames.  Is there anything I can do to get this query to run?

 

SQL used:

SELECT

 

ef2.name EFName,

 

ef2.StartTime,

 

ef2.EndTime,

 

e.Name Element,

 

ea.Name Attribute,

 

i.Time,

 

i.Value,

 

i.ValueDbl,

 

i.ValueStr,

 

i.IsGood

 

FROM [LSM_SSM_PRIMARY].[EventFrame].[EventFrame] ef2

 

INNER JOIN [LSM_SSM_PRIMARY].[Asset].[ElementHierarchy] eh on eh.ElementID = ef2.PrimaryReferencedElementID  

 

INNER JOIN [LSM_SSM_PRIMARY].[Asset].[Element] e ON e.Name = eh.Name + ' Chrome Skid'       

 

INNER JOIN [LSM_SSM_PRIMARY].[Asset].[ElementAttribute] ea ON ea.ElementID = e.ID

 

,[LSM_SSM_PRIMARY].[Data].[ft_InterpolateRange] i

 

WHERE ef2.name='EQUILIBRATION'

 

and ef2.PrimaryParentID='c3491a60-4ff9-47b6-0000-000000025fc3'

 

AND ea.Name='Feed Flow Totalizer'

 

AND i.ElementAttributeID = ea.ID -- first InterpolateRange TVF argument

 

AND i.StartTime = ef2.StartTime -- second InterpolateRange TVF argument

 

AND i.EndTime = ef2.EndTime -- third InterpolateRange TVF argument

 

AND i.TimeStep = N'1h' -- fourth InterpolateRange TVF argument

 

OPTION (FORCE ORDER, EMBED ERRORS)

Outcomes