TimeStampDiff function ROUNDing the result. How can we avoid this?

Hi,
I am using the following timestamp function:
TIMESTAMPDIFF(SQL_TSI_HOUR, "SF_CS_CS_Fact"."Crtddt_Dt", "SF_Emlmssg_Sum_CS"."Initl Resp Tm")
I notice that the result set is rounded off to the whole no.
This is happening because OBIEE autimatically ROUNDS the difference of the timestamps whe using TIMESTAMPDIFF:
select distinct D1.c1 as c1,
D1.c2 as c2,
D1.c3 as c3,
D1.c4 as c4,
D1.c5 as c5,
D1.c6 as c6,
D1.c7 as c7,
D1.c8 as c8,
D1.c9 as c9,
D1.c10 as c10
from
(select D1.c1 as c1,
D1.c2 as c2,
D1.c3 as c3,
D1.c4 as c4,
D1.c5 as c5,
D1.c6 as c6,
D1.c7 as c7,
D1.c8 as c8,
D1.c9 as c9,
D1.c10 as c10
from
(select 0 as c1,
D1.c4 as c2,
D1.c5 as c3,
D1.c3 as c4,
D1.c2 as c5,
D1.c6 as c6,
D1.c7 as c7,
D1.c8 as c8,
D1.c9 as c9,
D1.c1 as c10,
ROW_NUMBER() OVER (PARTITION BY D1.c2, D1.c3, D1.c4, D1.c5, D1.c6, D1.c7, D1.c8, D1.c9 ORDER BY D1.c2 ASC, D1.c3 ASC, D1.c4 ASC, D1.c5 ASC, D1.c6 ASC, D1.c7 ASC, D1.c8 ASC, D1.c9 ASC) as c11
from
(select distinct ROUND ( ( CAST(T14421.INITIAL_RESPONSE_TIME as DATE)  - CAST(T14963.CRTDDT_DT as DATE)  ) 24 ) as c1*,
T14963.CRTDDT_DT as c2,
T14963.CSNMBR as c3,
T4813.FISCAL_YEAR_NAME as c4,
T4813.FISCAL_QUARTER_NAME as c5,
T14421.INITIAL_RESPONSE_TIME as c6,
T14468.GRP as c7,
T4813.FISCAL_YEAR_ID as c8,
T4813.FISCAL_QUARTER_ID as c9
from
DW_SF_EMLMSSG_SUM_CS T14421,
DW_SF_EMLMSSG_CS T14400,
SF_ORGN_CS_DIM T14468,
CIN_CALENDARS_DIM T4813,
DW_SF_CS_CS T14963 /* SF_CS_CS_Fact */
where ( T14400.PRNTID = T14963.ID and T4813.CALENDAR_KEY = T14963.CRDT_KEY and T14421.PRNTID = T14963.ID and T14400.STTS = '3' and T14468.ORGN_KEY = T14963.ORGN_KEY and T14963.TYP = 'CIN' and (T14963.CSNMBR in ('1103676964', '1103677035', '1103677076', '1103677285', '1103677303', '1103677369', '1103677389')) )
) D1
) D1
where ( D1.c11 = 1 )
) D1
order by c1, c8, c9, c7, c4, c5, c6, c10
Please see the line in Bold in the query.
I want to get the results in the actual decimal point and not the whole no. Is there a way that I can enable the TIMESTAMPDIFF not to ROUND by default.
Any answers will be helpful.
Thanks,

When you specify in the interval in the first argument of TIMESTAMPDIFF you are implicitly telling OBIEE the level of precision that you want. For SQL_TSI_YEAR you are going to get integer values of whole years. if yo uneed to get more granular than that you need to use SQL_TSI_MONTH or WEEK.
Also note, than when performing mathematical operations like divide an multiply, all elements of the calculation need to be a data type that can represent decimal values, or the result of the entire calc will always get converted to an integer.

Similar Messages

Maybe you are looking for