Search code examples
sqloracle-databasecharobiee

Convert Oracle SQL to OBIEE Evaluate/TO_CHAR Function


Im trying to convert Oracle SQL Developer Select Statement into an Oracle BI function.

Seems like Evaluate is the way to go but the syntax is a little confusing so any help is appreciated. The SQL Dev Code is below for 2 select Statements:

TRIM(TO_CHAR(COUNT(*), '999,999,999,999,999')) AS Row_Count
TRIM(TO_CHAR(SUM(N_MODEL_ISS_AGE), '999,999,999,999,999')) AS Age

Solution

  • Those bits of SQL are there for formatting the resulting number into a more "nice to read" format. OBIEE is an Analytical platform and formatting has nothing to do with querying data. You build your analysis, select the attributes and measures you want and on each column you will be able to set the format you want for the values. Formatting is separated from retrieving data as formatting is only something which matter for rendering.

    On each column in the criteria tab of the analysis you have "Column Properties" > "Data Format". You either pick a predefined format or set to 'custom' and enter your own format mask.