OBIEE FUNCTIONS

EXPRESSIONS Case (Switch) Syntax CASE expr1 WHEN expr2 THEN expr3 ELSE expr4 END Description This form of the Case statement is also referred to as the CASE (Lookup) form. The value of expression1 is examined, then the WHEN expressions. If expression1 matches any WHEN expression, it assigns the value in the corresponding THEN expression. If none of the WHEN expressions match, it assigns the default value specified in the ELSE expression. If no ELSE expression is specified, the system will automatically add an ELSE NULL. Case (If) Syntax CASE WHEN request_condition1 THEN expr1 ELSE expr2 END

Description This form of the Case statement evaluates each WHEN condition and if satisfied, assigns the value in the corresponding THEN expression. If none of the WHEN conditions are satisfied, it assigns the default value specified in the ELSE expression. If no ELSE expression is specified, the system will automatically add an ELSE NULL. SYSTEM

USER() Description Returns the user name for the Oracle BI Repository to which you are logged on. SelectedDatabaseSyntax DATABASE() Description Returns the name of the Oracle BI subject area to which you are logged on. CONVERTIONS Cast Syntax CAST(expr AS type)

Description Changes the data type of a value or a null value to another data type. IfNull Syntax IFNULL(expr, value) Description Tests if an expression evaluates to a null value, and if it does, assigns the specified value to the expression. ValueOf Syntax VALUEOF(expr) Description Use the VALUEOF function in a filter to reference the value of an Oracle BI repository variable. AGGREGATE Avg Syntax Avg(expr) Description Calculates the average (mean) value of an expression in a result set. AvgDistinct Syntax Avg(DISTINCT expr) Description Calculates the average (mean) of all distinct values of an expression. BottomN Syntax BottomN(expr, integer)

CountDistinct Syntax COUNT(DISTINCT expr) Description Adds distinct processing to the Count function. Count Syntax COUNT(expr) Description Calculates the number of rows having a non-null value for the expression. Mavg Syntax MAVG(expr. Max Syntax MAX(expr) Description . 1 corresponding to the lowest numerical value. integer) Description Calculates a moving average (mean) for the last n rows of data. inclusive of the current row.Description Ranks the lowest n values of the expression argument from 1 to n. Count* Syntax COUNT(*) Description Counts the number of rows.

Calculates the maximum value (highest numeric value) of the rows satisfying the numeric expression argument. Rank Syntax RANK(expr) Description . NTile with numTiles=100 returns what is commonly called the "percentile" (with numbers ranging from 1 to 100. It returns integers to represent any range of ranks. with 100 representing the high end of the sort). numTiles) Description Determines the rank of a value in terms of a user-specified range. The percentile rank ranges are between 0 (0th percentile) to 1 (100th percentile). Median Syntax MEDIAN(expr) Description Calculates the median (middle) value of the rows satisfying the numeric expression argument. Percentile Syntax PERCENTILE(expr) Description Calculates a percentile rank for each value satisfying the numeric expression argument. Min Syntax MIN(expr) Description Calculates the minimum value (lowest numeric value) of the rows satisfying the numeric expression argument. NTile Syntax NTILE(expr.

. 7. 1. 1.Calculates the rank for each value satisfying the numeric expression argument. Sum Syntax SUM(expr) Description Calculates the sum obtained by adding up all values satisfying the numeric expression argument. StdDev_Pop Syntax STDDEV_POP(expr) Description Returns the standard deviation for a set of values using the computational formula for population variance and standard deviation. 4. 1. integer) .. The highest number is assigned a rank of 1.). If certain values are equal. 4. 5. TopN Syntax TOPN(expr. 3. they are assigned the same rank (for example. and each successive rank is assigned the next consecutive integer (2. StdDev Syntax STDDEV(expr) Description Returns the standard deviation for a set of values.. SumDistinct Syntax Sum(DISTINCT expr) Description Calculates the sum obtained by adding all of the distinct values satisfying the numeric expression argument. 5..)..

1 corresponding to the highest numerical value. MSUM Syntax MSUM (expr. integer) Description This function calculates a moving sum for the last n rows of data. inclusive of the current row.Description Ranks the highest n values of the expression argument from 1 to n. RCOUNT Syntax RCOUNT(expr) Description This function takes a set of records as input and counts the number of records encountered so far. RMAX Syntax . inclusive of the current row. integer) Description Calculates a moving average (mean) for the last n rows of data in the result set. RUNNING AGGREGATE MAVG Syntax MAVG (expr. RSUM Syntax RSUM(expr) Description This function calculates a running sum based on records encountered so far.

RMAX(expr) Description This function takes a set of records as input and shows the maximum value based on records encountered so far. . Bit_Length Syntax BIT_LENGTH(expr) Description Returns the length. Char Syntax CHAR(expr) Description Converts a numerical value between 0 and 255 to the character value corresponding to the ASCII code. which is equal to 16 bits. in bits. between 0 and 255. STRING ASCII Syntax ASCII(expr) Description Converts a single character string to its corresponding ASCII code. Each Unicode character is 2 bytes in length. of a specified string. RMIN Syntax RMIN(expr) Description This function takes a set of records as input and shows the minimum value based on records encountered so far.

Concat Syntax CONCAT(expr1. expr2) Description Inserts a specified character string into a specified location in another character string. Left Syntax LEFT(expr. expr2) Description Concatenates two character strings. integer2. Locate . integer) Description Returns a specified number of characters from the left of a string. integer1. in number of characters. of a specified string. The length is returned excluding any trailing blank characters. Insert Syntax INSERT(expr1.Char_Length Syntax CHAR_LENGTH(expr) Description Returns the length. in number of characters. of a specified string. Length Syntax LENGTH(expr) Description Returns the length.

Lower Syntax LOWER(expr) Description Converts a character string to lowercase. LocateN Syntax LOCATEN(expr1. This is identical to the Locate function. of a specified string. integer) Description Returns the numerical position of a character string in another character string.Syntax LOCATE(expr1. except that the search begins at the position specified by an integer argument. in base 8 units (number of bytes). Repeat . Octet_Length Syntax OCTET_LENGTH(expr) Description Returns the number of bits. expr2) Description Returns the numerical position of a character string in another character string. Position Syntax POSITION(expr1 IN expr2) Description Returns the numerical position of expr1 in a character expression. expr2.

Substring Syntax SUBSTRING(expr FROM startPos FOR length) Description Creates a new string starting from a fixed number of characters into the original string. expr2. integer) Description Repeats a specified expression n times. TrimBoth Syntax . expr3) Description Replaces one or more characters from a specified character expression with one or more other characters. Replace Syntax REPLACE(expr1. Space Syntax SPACE(expr) Description Inserts blank spaces. integer) Description Returns a specified number of characters from the right of a string.Syntax REPEAT(expr. Right Syntax RIGHT(expr.

TrimLeading Syntax TRIM(LEADING char FROM expr) Description Strips specified leading characters from a character string. MATHS Abs Syntax ABS(expr) Description Calculates the absolute value of a numerical expression. Upper Syntax UPPER(expr) Description Converts a character string to uppercase. Acos Syntax ACOS(expr) . TrimTrailing Syntax TRIM(TRAILING char FROM expr) Description Strips specified trailing characters from a character string.TRIM(BOTH char FROM expr) Description Strips specified leading and trailing characters from a character string.

expr2) Description Calculates the arc tangent of y/x. Ceiling Syntax CEILING(expr) Description Rounds a noninteger numerical expression to the next highest integer. where y is the first numerical expression and x is the second numerical expression. Atan Syntax ATAN(expr) Description Calculates the arc tangent of a numerical expression.Description Calculates the arc cosine of a numerical expression. Asin Syntax ASIN(expr) Description Calculates the arc sine of a numerical expression. Atan2 Syntax ATAN2(expr1. Cos Syntax COS(expr) Description .

Calculates the cosine of a numerical expression. Log10 . Log Syntax LOG(expr) Description Calculates the natural logarithm of an expression. Exp Syntax EXP(expr) Description Sends the value to the power specified. Cot Syntax COT(expr) Description Calculates the cotangent of a numerical expression. Degrees Syntax DEGREES(expr) Description Converts an expression from radians to degrees. Floor Syntax FLOOR(expr) Description Rounds a noninteger numerical expression to the next lowest integer.

expr2) Description Takes the first numerical expression and raises it to the power specified in the second numerical expression. Pi Syntax PI() Description Returns the constant value of pi (the circumference of a circle divided by its diameter). Radians Syntax RADIANS(expr) Description Converts an expression from degrees to radians. Rand . expr2) Description Divides the first numerical expression by the second numerical expression and returns the nonremainder portion of the quotient. Power Syntax POWER(expr1. Mod Syntax MOD(expr1.Syntax LOG10(expr) Description Calculates the base 10 logarithm of an expression.

1 if it evaluates to a negative number. RandFromSeed Syntax RAND(expr) Description Returns a pseudo-random number based on a seed value. or 0 (zero) if it evaluates to zero. Round Syntax ROUND(expr. Sign Syntax SIGN(expr) Description Returns: 1 if the numerical expression argument evaluates to a positive number. Sqrt Syntax .Syntax RAND() Description Returns a pseudo-random number between 0 and 1. integer) Description Rounds a numerical expression to n digits of precision. Sin Syntax SIN(expr) Description Calculates the sine of a numerical expression.

Truncate Syntax TRUNCATE(expr. The time is determined by the system in which the Oracle BI Server is running. Current_Time Syntax CURRENT_TIME(expr) Description Returns the current time. The date is determined by the system in which the Oracle BI Server is running. integer) Description Truncates a decimal number to return a specified number of places from the decimal point.SQRT(expr) Description Calculates the square root of the numerical expression argument. DATE FUNCTIONS Current_Date Syntax CURRENT_DATE Description Returns the current date. Tan Syntax TAN(expr) Description Calculates the tangent of a numerical expression. Current_Time .

DayName Syntax DAYNAME(expr) Description Returns the name of the day for a specified date. The timestamp is determined by the system in which the Oracle BI is running. Sunday through Saturday. DayOfMonth Syntax DAYOFMONTH(expr) Description Returns the number corresponding to the day of the month for a specified date. DayOfWeek Syntax DAYOFWEEK(expr) Description Returns a number between 1 and 7 corresponding to the day of the week.StampSyntax CURRENT_TIMESTAMP(expr) Description Returns the current date/timestamp. Day_of_Quarter Syntax DAY_OF_QUARTER(expr) Description Returns a number (between 1 and 92) corresponding to the day of the quarter for the specified date. DayOfYear . for a specified date.

Month Syntax MONTH(expr) Description Returns a number (between 1 and 12) corresponding to the month for a specified date. .Syntax DAYOFYEAR(expr) Description Returns the number (between 1 and 366) corresponding to the day of the year for a specified date. Month_Of_Quarter Syntax MONTH_OF_QUARTER(expr) Description Returns the number (between 1 and 3) corresponding to the month in the quarter for a specified date. Minute Syntax MINUTE(expr) Description Returns the number (between 0 and 59) corresponding to the minute for a specified time. Hour Syntax HOUR(expr) Description Returns the number (between 0 and 23) corresponding to the hour for a specified time.

expr. Second Syntax SECOND(expr) Description Returns the number (between 0 and 59) corresponding to the seconds for a specified time. timestamp) Description Adds a specified number of intervals to a specified timestamp. and returns a single timestamp. . This function is equivalent to the function Current_TimeStamp. TimestampAdd Syntax TIMESTAMPADD(interval. Now Syntax NOW() Description Returns the current timestamp.MonthName Syntax MONTHNAME(expr) Description Returns the name of the month for a specified date. Quarter_Of_Year Syntax QUARTER_OF_YEAR(expr) Description Returns the number (between 1 and 4) corresponding to the quarter of the year for a specified date.

Week_Of_Quarter Syntax WEEK_OF_QUARTER(expr) Description Returns a number (between 1 and 13) corresponding to the week of the quarter for the specified date. timestamp2) Description Returns the total number of specified intervals between two timestamps.TimestampDiff Syntax TIMESTAMPDIFF(interval. . expr. Year Syntax YEAR(expr) Description Returns the year for the specified date. Week_Of_Year Syntax WEEK_OF_YEAR(expr) Description Returns a number (between 1 and 53) corresponding to the week of the year for the specified date.