Monday, February 15, 2010

OBIEE Performance tuning

WORK_DIRECTORY_PATHS

From the OBIEE documentation:
Specifies one or more directories for temporary space.
Each directory listed needs to be an existing fully-qualified, writable directory pathname, with double quotes ( " ) surrounding the pathname. Specify mapped directories only. UNC path names and network mapped drives are allowed only if the service runs under a qualified user account. To change the account under which the service is running, see the corresponding topic in the Oracle Business Intelligence Enterprise Edition Deployment Guide.
Specify multiple directories with a comma separated list. Valid values are any fully qualified pathname to an existing, writable directory.
For optimum performance, temporary directories should reside on high performance storage devices.
If you specify more than one directory, they should reside on different drives.
Syntax: WORK_DIRECTORY_PATHS = "" [,""{, ""}] ;

Example 1: WORK_DIRECTORY_PATHS = "C:\Temp" ;
Example 2: WORK_DIRECTORY_PATHS = "D:\temp", "F:\temp" ;

NOTE: Specifying more than one directory per drive does not improve performance because file I/O takes place through the same I/O controller. In general, specify only one directory per disk drive.
Specifying multiple directories on different drives improves the overall I/O throughput of the Oracle Business Intelligence Server because internally, the processing files are allocated using a roundrobin algorithm that balances the I/O load across the given disk drives.
Rule of thumb: Invest in fast drives, consider virtual / RAM drives.

SORT_MEMORY_SIZE

From the OBIEE documentation:
Specifies the maximum amount of memory to be used for each sort operation. Multiple operations can each use memory up to the value specified. The limit for SORT_MEMORY_SIZE is determined by the physical memory of the server machine and on the number of sort operations that might occur simultaneously. Specify KB for kilobytes, MB for megabytes, and no units for bytes.
Example: SORT_MEMORY_SIZE = 4 MB ;
The size specified by SORT_MEMORY_SIZE sets the upper limit on how large the sorting buffer can be in the Oracle Business Intelligence Server. When this limit is exceeded, data is sorted in allotments of the size set by SORT_MEMORY_SIZE and the sorted sets are merged together. For example, suppose SORT_MEMORY_SIZE is set to 4 MB and the size of the data to be sorted is 32 MB. The server performs the sort once per each 4 MB of data, for a total of eight sort operations,
and then merge the results into a single result set. This technique allows the Oracle Business Intelligence Server to sort data of indefinite size.
The merge process itself is generally not costly in terms of resources, but it does include a read and write of each result set in a temporary file. To reduce the time this takes, increase the SORT_MEMORY_SIZE. This parameter can be tuned over time by taking into consideration the data size of the query and the number of concurrent users.
Rule of thumb: Don’t go overboard with this value, 10mb for a hundred concurrent users is 1 Gb of server memory. Don’t let OBIEE push other processes into the swap memory of the OS.

SORT_BUFFER_INCREMENT_SIZE

From the documentation:
Specifies the increment that the sort memory size is increased by as more memory is needed. As more memory is required, the size increases by the value specified until it reaches the value of
SORT_MEMORY_SIZE.
Example: SORT_BUFFER_INCREMENT_SIZE = 256 KB ;
This parameter defines the increment by which SORT_MEMORY_SIZE should be reached. For example, suppose SORT_MEMORY_SIZE is set to 4 MB and the data to be sorted is just one megabyte. As data is fed into the sort routine, the size of the sort buffer increases only by the increment size, rather than the full size allowed by SORT_MEMORY_SIZE. This mechanism allows the Oracle Business Intelligence Server to sort smaller result sets efficiently without wasting memory.
Rule of thumb: 5 – 10 % of the SORT_MEMORY_SIZE

VIRTUAL_TABLE_PAGE_SIZE

From the documentation:
Several operations—sort, join, union and database fetch—can require memory resources beyond those available to the Oracle Business Intelligence Server. To manage this condition, the server uses a virtual table management mechanism that provides a buffering scheme for processing these operations. When the amount of data exceeds the VIRTUAL_TABLE_PAGE_SIZE, the remaining data is buffered in a temporary file and placed in the virtual table as processing
continues. This mechanism supports dynamic memory sizes and ensures that any row can be obtained dynamically for processing queries.
When VIRTUAL_TABLE_PAGE_SIZE is increased, I/O operations are reduced. Complex queries may use 20 to 30 virtual tables, while simple queries may not even require virtual tables. The
default size of 128 KB is a reasonable size when one considers that the size for virtual paging in Windows NT is 64 KB. This parameter can be tuned depending on the number of concurrent users and the average query complexity. In general, setting the size higher than 256 KB does not yield a corresponding increase in throughput due to the 64 KB size limit of Windows NT system buffers, as each I/O still goes through the system buffers
Rule of thumb: Trust the documentation, more then 256 KB is not necessary.
All the parameters are set in the NQSConfig.INI File

HTML Color Codes

Major hexadecimal color codes
Color Color Code Color Color Code
Red #FF0000 White #FFFFFF
Turquoise #00FFFF Light Grey #C0C0C0
Light Blue #0000FF Dark Grey #808080
Dark Blue #0000A0 Black #000000
Light Purple #FF0080 Orange #FF8040
Dark Purple #800080 Brown #804000
Yellow #FFFF00 Burgundy #800000
Pastel Green #00FF00 Forest Green #808000
Pink #FF00FF Grass Green #408080

Color code chart

COLOR NAME CODE COLOR
Black #000000 Black
Gray0 #150517 Gray0
Gray18 #250517 Gray18
Gray21 #2B1B17 Gray21
Gray23 #302217 Gray23
Gray24 #302226 Gray24
Gray25 #342826 Gray25
Gray26 #34282C Gray26
Gray27 #382D2C Gray27
Gray28 #3b3131 Gray28
Gray29 #3E3535 Gray29
Gray30 #413839 Gray30
Gray31 #41383C Gray31
Gray32 #463E3F Gray32
Gray34 #4A4344 Gray34
Gray35 #4C4646 Gray35
Gray36 #4E4848 Gray36
Gray37 #504A4B Gray37
Gray38 #544E4F Gray38
Gray39 #565051 Gray39
Gray40 #595454 Gray40
Gray41 #5C5858 Gray41
Gray42 #5F5A59 Gray42
Gray43 #625D5D Gray43
Gray44 #646060 Gray44
Gray45 #666362 Gray45
Gray46 #696565 Gray46
Gray47 #6D6968 Gray47
Gray48 #6E6A6B Gray48
Gray49 #726E6D Gray49
Gray50 #747170 Gray50
Gray #736F6E Gray
Slate Gray4 #616D7E Slate Gray4
Slate Gray #657383 Slate Gray
Light Steel Blue4 #646D7E Light Steel Blue4
Light Slate Gray #6D7B8D Light Slate Gray
Cadet Blue4 #4C787E Cadet Blue4
Dark Slate Gray4 #4C7D7E Dark Slate Gray4
Thistle4 #806D7E Thistle4
Medium Slate Blue #5E5A80 Medium Slate Blue
Medium Purple4 #4E387E Medium Purple4
Midnight Blue #151B54 Midnight Blue
Dark Slate Blue #2B3856 Dark Slate Blue
Dark Slate Gray #25383C Dark Slate Gray
Dim Gray #463E41 Dim Gray
Cornflower Blue #151B8D Cornflower Blue
Royal Blue4 #15317E Royal Blue4
Slate Blue4 #342D7E Slate Blue4
Royal Blue #2B60DE Royal Blue
Royal Blue1 #306EFF Royal Blue1
Royal Blue2 #2B65EC Royal Blue2
Royal Blue3 #2554C7 Royal Blue3
Deep Sky Blue #3BB9FF Deep Sky Blue
Deep Sky Blue2 #38ACEC Deep Sky Blue2
Slate Blue #357EC7 Slate Blue
Deep Sky Blue3 #3090C7 Deep Sky Blue3
Deep Sky Blue4 #25587E Deep Sky Blue4
Dodger Blue #1589FF Dodger Blue
Dodger Blue2 #157DEC Dodger Blue2
Dodger Blue3 #1569C7 Dodger Blue3
Dodger Blue4 #153E7E Dodger Blue4
Steel Blue4 #2B547E Steel Blue4
Steel Blue #4863A0 Steel Blue
Slate Blue2 #6960EC Slate Blue2
Violet #8D38C9 Violet
Medium Purple3 #7A5DC7 Medium Purple3
Medium Purple #8467D7 Medium Purple
Medium Purple2 #9172EC Medium Purple2
Medium Purple1 #9E7BFF Medium Purple1
Light Steel Blue #728FCE Light Steel Blue
Steel Blue3 #488AC7 Steel Blue3
Steel Blue2 #56A5EC Steel Blue2
Steel Blue1 #5CB3FF Steel Blue1
Sky Blue3 #659EC7 Sky Blue3
Sky Blue4 #41627E Sky Blue4
Slate Blue #737CA1 Slate Blue
Slate Blue #737CA1 Slate Blue
Slate Gray3 #98AFC7 Slate Gray3
Violet Red #F6358A Violet Red
Violet Red1 #F6358A Violet Red1
Violet Red2 #E4317F Violet Red2
Deep Pink #F52887 Deep Pink
Deep Pink2 #E4287C Deep Pink2
Deep Pink3 #C12267 Deep Pink3
Deep Pink4 #7D053F Deep Pink4
Medium Violet Red #CA226B Medium Violet Red
Violet Red3 #C12869 Violet Red3
Firebrick #800517 Firebrick
Violet Red4 #7D0541 Violet Red4
Maroon4 #7D0552 Maroon4
Maroon #810541 Maroon
Maroon3 #C12283 Maroon3
Maroon2 #E3319D Maroon2
Maroon1 #F535AA Maroon1
Magenta #FF00FF Magenta
Magenta1 #F433FF Magenta1
Magenta2 #E238EC Magenta2
Magenta3 #C031C7 Magenta3
Medium Orchid #B048B5 Medium Orchid
Medium Orchid1 #D462FF Medium Orchid1
Medium Orchid2 #C45AEC Medium Orchid2
Medium Orchid3 #A74AC7 Medium Orchid3
Medium Orchid4 #6A287E Medium Orchid4
Purple #8E35EF Purple
Purple1 #893BFF Purple1
Purple2 #7F38EC Purple2
Purple3 #6C2DC7 Purple3
Purple4 #461B7E Purple4
Dark Orchid4 #571B7e Dark Orchid4
Dark Orchid #7D1B7E Dark Orchid
Dark Violet #842DCE Dark Violet
Dark Orchid3 #8B31C7 Dark Orchid3
Dark Orchid2 #A23BEC Dark Orchid2
Dark Orchid1 #B041FF Dark Orchid1
Plum4 #7E587E Plum4
Pale Violet Red #D16587 Pale Violet Red
Pale Violet Red1 #F778A1 Pale Violet Red1
Pale Violet Red2 #E56E94 Pale Violet Red2
Pale Violet Red3 #C25A7C Pale Violet Red3
Pale Violet Red4 #7E354D Pale Violet Red4
Plum #B93B8F Plum
Plum1 #F9B7FF Plum1
Plum2 #E6A9EC Plum2
Plum3 #C38EC7 Plum3
Thistle #D2B9D3 Thistle
Thistle3 #C6AEC7 Thistle3
Lavender Blush2 #EBDDE2 Lavender Blush2
Lavender Blush3 #C8BBBE Lavender Blush3
Thistle2 #E9CFEC Thistle2
Thistle1 #FCDFFF Thistle1
Lavender #E3E4FA Lavender
Lavender Blush #FDEEF4 Lavender Blush
Light Steel Blue1 #C6DEFF Light Steel Blue1
Light Blue #ADDFFF Light Blue
Light Blue1 #BDEDFF Light Blue1
Light Cyan #E0FFFF Light Cyan
Slate Gray1 #C2DFFF Slate Gray1
Slate Gray2 #B4CFEC Slate Gray2
Light Steel Blue2 #B7CEEC Light Steel Blue2
Turquoise1 #52F3FF Turquoise1
Cyan #00FFFF Cyan
Cyan1 #57FEFF Cyan1
Cyan2 #50EBEC Cyan2
Turquoise2 #4EE2EC Turquoise2
Medium Turquoise #48CCCD Medium Turquoise
Turquoise #43C6DB Turquoise
Dark Slate Gray1 #9AFEFF Dark Slate Gray1
Dark Slate Gray2 #8EEBEC Dark slate Gray2
Dark Slate Gray3 #78c7c7 Dark Slate Gray3
Cyan3 #46C7C7 Cyan3
Turquoise3 #43BFC7 Turquoise3
Cadet Blue3 #77BFC7 Cadet Blue3
Pale Turquoise3 #92C7C7 Pale Turquoise3
Light Blue2 #AFDCEC Light Blue2
Dark Turquoise #3B9C9C Dark Turquoise
Cyan4 #307D7E Cyan4
Light Sea Green #3EA99F Light Sea Green
Light Sky Blue #82CAFA Light Sky Blue
Light Sky Blue2 #A0CFEC Light Sky Blue2
Light Sky Blue3 #87AFC7 Light Sky Blue3
Sky Blue #82CAFF Sky Blue
Sky Blue2 #79BAEC Sky Blue2
Light Sky Blue4 #566D7E Light Sky Blue4
Sky Blue #6698FF Sky Blue
Light Slate Blue #736AFF Light Slate Blue
Light Cyan2 #CFECEC Light Cyan2
Light Cyan3 #AFC7C7 Light Cyan3
Light Cyan4 #717D7D Light Cyan4
Light Blue3 #95B9C7 Light Blue3
Light Blue4 #5E767E Light Blue4
Pale Turquoise4 #5E7D7E Pale Turquoise4
Dark Sea Green4 #617C58 Dark Sea Green4
Medium Aquamarine #348781 Medium Aquamarine
Medium Sea Green #306754 Medium Sea Green
Sea Green #4E8975 Sea Green
Dark Green #254117 Dark Green
Sea Green4 #387C44 Sea Green4
Forest Green #4E9258 Forest Green
Medium Forest Green #347235 Medium Forest Green
Spring Green4 #347C2C Spring Green4
Dark Olive Green4 #667C26 Dark Olive Green4
Chartreuse4 #437C17 Chartreuse4
Green4 #347C17 Green4
Medium Spring Green #348017 Medium Spring Green
Spring Green #4AA02C Spring Green
Lime Green #41A317 Lime Green
Spring Green #4AA02C Spring Green
Dark Sea Green #8BB381 Dark Sea Green
Dark Sea Green3 #99C68E Dark Sea Green3
Green3 #4CC417 Green3
Chartreuse3 #6CC417 Chartreuse3
Yellow Green #52D017 Yellow Green
Spring Green3 #4CC552 Spring Green3
Sea Green3 #54C571 Sea Green3
Spring Green2 #57E964 Spring Green2
Spring Green1 #5EFB6E Spring Green1
Sea Green2 #64E986 Sea Green2
Sea Green1 #6AFB92 Sea Green1
Dark Sea Green2 #B5EAAA Dark Sea Green2
Dark Sea Green1 #C3FDB8 Dark Sea Green1
Green #00FF00 Green
Lawn Green #87F717 Lawn Green
Green1 #5FFB17 Green1
Green2 #59E817 Green2
Chartreuse2 #7FE817 Chartreuse2
Chartreuse #8AFB17 Chartreuse
Green Yellow #B1FB17 Green Yellow
Dark Olive Green1 #CCFB5D Dark Olive Green1
Dark Olive Green2 #BCE954 Dark Olive Green2
Dark Olive Green3 #A0C544 Dark Olive Green3
Yellow #FFFF00 Yellow
Yellow1 #FFFC17 Yellow1
Khaki1 #FFF380 Khaki1
Khaki2 #EDE275 Khaki2
Goldenrod #EDDA74 Goldenrod
Gold2 #EAC117 Gold2
Gold1 #FDD017 Gold1
Goldenrod1 #FBB917 Goldenrod1
Goldenrod2 #E9AB17 Goldenrod2
Gold #D4A017 Gold
Gold3 #C7A317 Gold3
Goldenrod3 #C68E17 Goldenrod3
Dark Goldenrod #AF7817 Dark Goldenrod
Khaki #ADA96E Khaki
Khaki3 #C9BE62 Khaki3
Khaki4 #827839 Khaki4
Dark Goldenrod1 #FBB117 Dark Goldenrod1
Dark Goldenrod2 #E8A317 Dark Goldenrod2
Dark Goldenrod3 #C58917 Dark Goldenrod3
Sienna1 #F87431 Sienna1
Sienna2 #E66C2C Sienna2
Dark Orange #F88017 Dark Orange
Dark Orange1 #F87217 Dark Orange1
Dark Orange2 #E56717 Dark Orange2
Dark Orange3 #C35617 Dark Orange3
Sienna3 #C35817 Sienna3
Sienna #8A4117 Sienna
Sienna4 #7E3517 Sienna4
Indian Red4 #7E2217 Indian Red4
Dark Orange3 #7E3117 Dark Orange3
Salmon4 #7E3817 Salmon4
Dark Goldenrod4 #7F5217 Dark Goldenrod4
Gold4 #806517 Gold4
Goldenrod4 #805817 Goldenrod4
Light Salmon4 #7F462C Light Salmon4
Chocolate #C85A17 Chocolate
Coral3 #C34A2C Coral3
Coral2 #E55B3C Coral2
Coral #F76541 Coral
Dark Salmon #E18B6B Dark Salmon
Salmon1 #F88158 Pale Turquoise4
Salmon2 #E67451 Salmon2
Salmon3 #C36241 Salmon3
Light Salmon3 #C47451 Light Salmon3
Light Salmon2 #E78A61 Light Salmon2
Light Salmon #F9966B Light Salmon
Sandy Brown #EE9A4D Sandy Brown
Hot Pink #F660AB Hot Pink
Hot Pink1 #F665AB Hot Pink1
Hot Pink2 #E45E9D Hot Pink2
Hot Pink3 #C25283 Hot Pink3
Hot Pink4 #7D2252 Hot Pink4
Light Coral #E77471 Light Coral
Indian Red1 #F75D59 Indian Red1
Indian Red2 #E55451 Indian Red2
Indian Red3 #C24641 Indian Red3
Red #FF0000 Red
Red1 #F62217 Red1
Red2 #E41B17 Red2
Firebrick1 #F62817 Firebrick1
Firebrick2 #E42217 Firebrick2
Firebrick3 #C11B17 Firebrick3
Pink #FAAFBE Pink
Rosy Brown1 #FBBBB9 Rosy Brown1
Rosy Brown2 #E8ADAA Rosy Brown2
Pink2 #E7A1B0 Pink2
Light Pink #FAAFBA Light Pink
Light Pink1 #F9A7B0 Light Pink1
Light Pink2 #E799A3 Light Pink2
Pink3 #C48793 Pink3
Rosy Brown3 #C5908E Rosy Brown3
Rosy Brown #B38481 Rosy Brown
Light Pink3 #C48189 Light Pink3
Rosy Brown4 #7F5A58 Rosy Brown4
Light Pink4 #7F4E52 Light Pink4
Pink4 #7F525D Pink4
Lavender Blush4 #817679 Lavendar Blush4
Light Goldenrod4 #817339 Light Goldenrod4
Lemon Chiffon4 #827B60 Lemon Chiffon4
Lemon Chiffon3 #C9C299 Lemon Chiffon3
Light Goldenrod3 #C8B560 Light Goldenrod3
Light Golden2 #ECD672 Light Golden2
Light Goldenrod #ECD872 Light Goldenrod
Light Goldenrod1 #FFE87C Light Goldenrod1
Lemon Chiffon2 #ECE5B6 Lemon Chiffon2
Lemon Chiffon #FFF8C6 Lemon Chiffon
Light Goldenrod Yellow #FAF8CC Light Goldenrod Yellow

OBIEE Portal customization "the portalbanner"



After customizing the log on log off screen (http://obiee101.blogspot.com/2008/09/obiee-making-custom-log-on-and-log-off.html) it's time to customise the portal:
Title:
Appearance: Browser {title} {/title}, content: ProductMessages.xml => kmsgProductPortal

Background:
Appearance: portalbanner.css => .Headline, content: background-image: url(bg_banner.jpg);
PortalLinks:

Appearance: portalbanner.css => .PortalLinks, .PortalLink:link, .PortalLink:visited, .PortalLink:hover , content: Portalnames.
Portalname:


Appearance: portalbanner.css => .PortalName
Welcome text:
Appearance: portalbanner.css => .WelcomeTextCell, Content: uimessages.xml => kmsgUIWelcome

Dashboard actions:

Appereance: portalbanner.css => .DashBarIconCell, .DashBarAlertCell, .DashBarProductCell, .DashBarActiveProductCell, .DashBarActionCell, Content: uimessages.xml => kmsgUIPortal, kmsgUIAnswers, kmsgUIProductsLink, kmsgUISettings, kmsgUILogoff

This article was original written for the Ciber Knowledge Blog: http://knowledge.ciber.nl/weblog/?p=133

Thursday, February 11, 2010

OBIEE on the iPhone!



I have to confess, that yes, I gave into the all appealing glow of the Apple iTunes, iStore, iPod, all things “i” machine and purchased an iPhone about 6-months ago.
Fortunately for me, its a 3G and I love it.  It was a great price at $199 and has all of the functionality that my HTC Excalibur had and more. Tying my everlasting tech-toy joy in with my BI skillset, it was always a hope to leverage the mobile interface of one of my favorite analytic applications on the iPhone.  As we all know, Oracle last year released some of their iPhone applications which interface with your Oracle data via web services (SOA).
Oracle's Lacking iPhone OBIEE App Demo
Oracle's Lacking iPhone OBIEE App Demo
This is why I love OBIEE. The integrations just aren’t stopping. I’ll soon be writing a good article on integrating Google Maps with OBIEE, but for now let’s stay on topic.

I was so very excited to see the release of the  OBIEE iPhone application and to my surprise it is very much a non-event.  It’s nothing special at all.  I can’t say that I am disappointed but I will say that Oracle has a lot of work to do.  Maybe a version 2.0 is very close behind their current 1.2 release (July 3, 2008) but only time will tell.
So let’s air some grevancies.  First of all if you do a search on your favorite search engine for “OBIEE Iphone app” or any variances thereof you get very few solid hits.  A few OBIEE’rs have blogged on the topic but very few offer much substance.  Secondly, when you use Oracle’s site to search for the OBIEE iPhone app you will eventually come a cross this link on Oracle Business Indicators.  However, they for some reason obsfucate the actual means to get/download the iPhone application.  Why would they bury the lead? Are they not proud of this what should be amazing product like our open-source friend’s iPhone App at Pentaho?
By the way, here is the single link that will launch your iTunes application on your PC and take you immediately to the app page so that you can download the free Oracle iPhone App.
In Oracle’s defense here are the few semi-worthwhile links that Oracle offers for its Business Indicator iPhone application.
For the sake of brevity, I will say that I will continue with my current demo implementation of the Oracle Business Indicator iPhone Application and continue to work with it.  I would also recommend installing and configuring this for clients as in its current and very basic state it does delivery analytics from your OBIEE implementation.  I just won’t be happy with it until the next version if they continue to with the platform. (Are they serious that in one-year they haven’t had a new release of this software? Come on guys give us something!).  We’ll keep you updated when we here something new from Oracle.
Additional Information
After reviewing the SOA platform that has associated with OBIEE, I must say that it has some serious legs.  There is a lot that can be accomplished from a design and development aspect with the Oracle SOA Suite. Check out a great article on the topic here.  Also check out the Oracle SOA download, quickstart, and demos.

Wednesday, February 10, 2010

Difference Between Two Dates

I Tried to find how to calculate the Difference between two dates on OBIEE.
One solution that i found on the net is to use TimestampDiff Function. The problem for me was that the field data type that i wanted to see the difference was "DATE" and in the function the data type that used in the syntax is "TIMESTAMP".
Here is The Official review of the function:

TimestampDiff

Returns the total number of specified intervals between two timestamps. Passing a null timestamp to this function results in a null return value.
This function first determines the timestamp component that corresponds to the specified interval parameter, and then looks at the higher order components of both timestamps to calculate the total number of intervals for each timestamp. For example, if the specified interval corresponds to the month component, the function calculates the total number of months for each timestamp by adding the month component and twelve times the year component. Then the function subtracts the first timestamp's total number of intervals from the second timestamp's total number of intervals.
The TimestampDiff function rounds up to the next integer whenever fractional intervals represent a crossing of an interval boundary. For example, the difference in years between '1999-12-31' and '2000-01-01' is 1 year because the fractional year represents a crossing from one year to the next (such as 1999 to 2000). By contrast, the difference between '1999-01-01' and '1999-12-31' is zero years because the fractional interval falls entirely within a particular year (such as 1999). Microsoft's SQL Server exhibits the same rounding behavior, but IBM's DB2 does not; it always rounds down. Oracle does not implement a generalized timestamp difference function.
When calculating the difference in weeks, the function calculates the difference in days and divides by seven before rounding. Additionally, the function takes into account how the administrator has configured the start of a new week in the NQSConfig.ini file. For example, with Sunday as the start of the week, the difference in weeks between '2000-07-06' (a Thursday) and '2000-07-10' (the following Monday) results in a value of 1 week. With Tuesday as the start of the week, however, the function would return zero weeks since the fractional interval falls entirely within a particular week. When calculating the difference in quarters, the function calculates the difference in months and divides by three before rounding.
Oracle BI Server pushes down the TIMESTAMPADD and TIMESTAMPDIFF functions to Microsoft's SQL Server and ODBC databases by default. While Oracle BI Server can also push to IBM's DB2, the features table is turned off by default due to DB2's simplistic semantics. (IBM's DB2 provides a generalized timestamp difference function, TIMESTAMPDIFF, but it simplifies the calculation by always assuming a 365-day year, 52-week year, and 30-day month.) The features table is also turned off by default for Oracle, since Oracle databases do not fully support these functions.

Syntax

TimestampDiff(interval, timestamp1, timestamp2)
Where:
interval
The specified interval. Valid values are: SQL_TSI_SECOND, SQL_TSI_MINUTE, SQL_TSI_HOUR, SQL_TSI_DAY, SQL_TSI_WEEK, SQL_TSI_MONTH, SQL_TSI_QUARTER, SQL_TSI_YEAR.
timestamp1
Any valid timestamp.
timestamp2
Any valid timestamp.

Examples

Select {TimestampDiff(SQL_TSI_DAY, TIMESTAMP'1998-07-31 23:35:00', TIMESTAMP'2000-04-01 14:24:00')}
From Employee where employeeid = 2;
In the above example, the query asks for a difference in days between timestamps '1998-07-31 23:35:00' and '2000-04-01 14:24:00'. It returns a value of 610. Notice that the leap year in 2000 results in an additional day.


My Solution was to Convert the data type of the field from "Date" to "TIMESTAMP".
Syntax: Cast("Date_Field" as Timestamp)

 
בניית אתרים