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
-
When I send a link to a page or website via email (Hotmail or Yahoo) it cannot be opened by the recipient. Instead it needs to be cut and pasted into their browser bar for them to open it.
This problem only started after loading Firefox on my computer and I wonder if you can help in any way.Just above the textarea that you use to enter the message text there is usually a button bar with buttons to add text formatting like Bold and Italic.<br />
That toolbar may also have a button to turn a text link into a clickable hyperlink (look for a chain like button).<br />
You can select the text and click that button to turn the link into a clickable hyperlink.<br />
If you can't find the button then hover them all to check the tooltip of each.<br />
* Make Link - https://addons.mozilla.org/firefox/addon/make-link/ -
I have an ipad and when I watch a video the audio does not match up with the video, how can I fix this?
Hello there, graciecloyd.
The following Knowledge Base article offers a few steps to try when an application is not functioning as expected:
iOS: Understanding multitasking
http://support.apple.com/kb/ht4211
If an app doesn't respond to your input, or doesn't perform as expected, do the following, testing after each step:
Check for app updates.
Force the app to close.
Restart your device.
Update your iOS device.
Learn more about troubleshooting apps.
On Step 2, close all applicaitons that are open. On Step 3, if the restart doesn't help resolve the issue, you may also want to try the Reset step in that article as well.
Thanks for reaching out to Apple Support Communities.
Cheers,
Pedro. -
HT4061 Am getting error 3194 unable to use the ipone, how can I rectify this?
Am getting error 3194 unable to use the ipone, how can I rectify this?
Unable to contact the iOS software update server gs.apple.com
Error 1004, 1013, 1638, 3014, 3194: These errors may be the result of the connection to gs.apple.com being redirected or blocked. Follow these steps to resolve these errors:
Install the latest version of iTunes.
Check security software. Ensure that communication to gs.apple.com is allowed. Follow this article for assistance with security software. iTunes for Windows: Troubleshooting security software issues.
Check the hosts file. The restore will fail if there is an active entry to redirect gs.apple.com. Follow iTunes: Advanced iTunes Store troubleshooting to edit the hosts file or revert to a default hosts file. See section "Blocked by configuration: (Mac OS X/Windows) > Rebuild network information".
Try to restore from another known-good computer and network.
If the errors persist on another computer, the device may need service. -
I already have an itunes account on my laptop but have been setup on a mac and have songs that have not been purchased from the itunes store, I cannot get the songs from my iPhone onto my itunes account on the mac. how can I do this?
You copy them from your old computer or your backup copy of your old computer.
The iphone is not a backup/storage device. -
When I create an email signature, the text I type is repeated twice in the actual email sent (above and below a line). How can I avoid this?
Try validating your installed fonts and fixing any errors that show up. To do this see this article: http://reviews.cnet.com/8301-13727_7-20085570-263/safari-in-os-x-lion-replacing- text-with-block-a-characters/
-
My mac is freezing all the time, how can I fix this?
My mac is freezing all the time, how can I fix this?
Run Disk Utility to verify/repair your drive(s). Boot from your installer dvd to repair the boot drive. If the repair reports that it fixed anything then see if your problem is fixed.
-
When I delete a file, it does not appear in the Trash - How can I fix this. Its a brand new MacBook Pro 17''
http://www.thexlab.com/faqs/trash.html for starters.
-
Hi I dropped my iphone 5 in water last night, it is working but has shadow over the screen how can I get this fixed?
Probably too late to do anything but replace the device at this point.
Once electronics get wet, the best thing to do is turn it off and put it in silica gels packs or uncooked rice for a minimum of 72hrs. Only then should the user attempt to power the device on. -
I have photoshop elements 12 and when I use the font tool it crashes the program, how can I fix this?I have a macbook pro
Use the crop tool.
On the tool's option bar, type 300 px & 200 px, and the desired resolution. -
the computer recently ask me for an update for mavericks and after i did the update there a white smug in the middle of the screen. how can i fix this?
smug?
-
HOW CAN I AVOID THIS ERROR MESAGE WHILE TRYING TO EXPORT AN IPHOTO SLIDESHOW: The operation couldn’t be completed. (OSStatus error -61.)
Hello,
I believe the issue was the external HD I purchased was not formatted for Mac . . . once I took care of that - all went well! The slide show transferred and the surprise 70th birthday party was a huge sucess. Thank you everyone! -
The customized settings on my toolbar periodically disappear, and I have to re-set them. How can I avoid this nuisance?
If you mean you're about to perform a restore from a backup to a new device, it depends on the app. Some will retain their passwords, some will not. That's my experience.
-
I am trying to make a one to one reservation with my new MacBook Air at a retail store of my choosing but each time I put in my password it kicks me over to the Apple store where I purchased the one to one service. How can I avoid this and reserve at the store of my choice?
I would try the 'old fashioned way, the telephone.
Ciao. -
my code panel has an entirely black background and i can not see the coding how can i correct this?
cs5 , windows, i don't even know how it changed? and yes all files but after 3 hrs burned here at work i figured it out:
Before:
click the format source code button
Preferance panel will show up>code coloring>Default Background
Correct:
Thank you for your reply
Message was edited by: Graphixqueen1
Maybe you are looking for
-
I want to stop using my Apple ID for my iPad, which I will give my daughter.
Dear friends, A month ago, I bought an iPad 4 for my 4-year-old daughter. I have used my Apple ID and bank account to buy Apps to install on the iPad. Now I do not want to use my Apple ID and bank account for this iPad (but I will use them for my iPh
-
i forgot my passcode for the ipad and i can't connect to iTunes because it keeps giving me error message that i have to unlcok the ipad first... any advice on how to restore the ipad or unlock it?
-
Switched from W7Beta to W7RC: Can no longer see Windows partion in OSX
Hey all, It's pretty much all spelled out in the title. Microsoft is pretty clear that upgrading is never an option with beta software. In light of that, I knew I would have to re-install the OS from scratch to upgrade from the beta to the retail can
-
Home sharing apple tv toshiba laptop
I have problems to set up apple tv and my Toshiba laptop for home sharing last night I watch a movie and everthing works but not now
-
Iphone running 2.1 does not check for new email in the background
hi my iphone does not get new email unless i open the mail app. it worked perfectly previous to now. this has been the case for a few weeks. i have asked several friends, who tell me that they have the same issue after upgrading. any solution? i use