Arithmetic expression does not have valid input types

tvinci
New Member

Hello,

What am I doing wrong with this expression?

Thank you.
Tiffany

Solved Solved
0 1 555
1 ACCEPTED SOLUTION

I believe, you may wish to convert part of expression from duration to number or decimal type by wrapping it by say TOTALHOURS()

So, please try to wrap following expression with TOTALHOURS() something like below
IF( TOTALHOURS([Driver Timestamp] - ANY(SELECT(delineatedLocations[Driver Timestamp], [Route]=[_THISROW].[Route]))) < -1,

TOTALHOURS([Driver Timestamp] - ANY(SELECT(delineatedLocations[Driver Timestamp], [Route]=[_THISROW].[Route])))* (-1),
TOTALHOURS([Driver Timestamp] - ANY(SELECT(delineatedLocations[Driver Timestamp], [Route]=[_THISROW].[Route])))
)

Edit: The above suggestion to wrap by TOTALHOURS() is based on assumptio that the difference between two timestamps is of the order of hours. This is so because the expression has number 1 in comparison part. If the difference is going to be always in minutes , then the expression could be wrapped with TOTALMINUTES() function as well.

View solution in original post

1 REPLY 1

I believe, you may wish to convert part of expression from duration to number or decimal type by wrapping it by say TOTALHOURS()

So, please try to wrap following expression with TOTALHOURS() something like below
IF( TOTALHOURS([Driver Timestamp] - ANY(SELECT(delineatedLocations[Driver Timestamp], [Route]=[_THISROW].[Route]))) < -1,

TOTALHOURS([Driver Timestamp] - ANY(SELECT(delineatedLocations[Driver Timestamp], [Route]=[_THISROW].[Route])))* (-1),
TOTALHOURS([Driver Timestamp] - ANY(SELECT(delineatedLocations[Driver Timestamp], [Route]=[_THISROW].[Route])))
)

Edit: The above suggestion to wrap by TOTALHOURS() is based on assumptio that the difference between two timestamps is of the order of hours. This is so because the expression has number 1 in comparison part. If the difference is going to be always in minutes , then the expression could be wrapped with TOTALMINUTES() function as well.

Top Labels in this Space