Showing posts with label Custom Data format. Show all posts
Showing posts with label Custom Data format. Show all posts

Wednesday, September 07, 2016

Different Tool tip for different column values in OBIEE11g/12c

In OBIEE 11g or 12c, we can add ToolTip to the report on columns. Last week i had a requirement to display different tooltips/text on every column value to users when user hovers on different row in that column of a report.
This is not an OBIEE feature. To get a solution to it, we can try using Javascript in Narrative view. But i tried a different solution.

Req: We have to display different text over different column values. For example below, we have to show Response values in ToolTip, when users hovers over the Product column. Responses can differ.






Step 1: So we created a Dummy KPI in RPD, called Responses and stored the different values (Good/Fair etc ) in it.
Step2: Now in Obiee Report, over the Product column made few changes:
     a) In the 'Column Properties' , under 'Data Format' tab, I am choosing HTML
     b) In column edit formula wrote below:

<HTML> <span title= ' || "Dim"."Responses"|| '>' || "Dim"."Product" ||' </span> <HTML>

Note:
i) You can skip using HTML.      
ii) You can write a Case formula in place of Product column, ie column on which you want the hover text.
iii) For Numeric column value, use Cast function to convert it to Char().


Courtesy: Google

Wednesday, July 13, 2016

Creating Word / Tag Clouds in Obiee 11g

Like we discussed in my other blog over D3 visualizations in Obiee 11g, we have another data visualization technique called “word clouds”, that is used to graphically show word distributions in unstructured data sets through font sizes and orientations. For example, the word cloud shown below display the company names in different sizes/fonts.




It can be implemented in OBIEE11g reports, without using any extra help. We just have to create a dummy column using any logic to get dummy values ranging between 5 to 70 and then in Narrative View we can use this column in font size of Company column.

for example: I created a dummy column C1 like (count Of Transaction) * 5) / Max (count Of Transaction). This will give me value range from 5 to 70 ( you can range your values depending on Font size required in Cloud).

Now in Narrative View, while displaying the Company name column, mention Style (font-size = @C1;) and its done.

Do try it.






Tuesday, October 06, 2015

Steps to Replace Null Values in an OBIEE Pivot Table with 'No Data' or 'N/A' or 'No Description' using Custom Data Format

Scenario: 
Sometimes it is necessary to display numeric values in specified format or replace the null values in table or pivot table with zeros or custom text. OBIEE Answers and Dashboards give us a possibility to customize the data masks for presentation. This could be useful when we want to change the display of data for the purpose of a given report. Using Custom Data Format feature we can change the masks for numeric values, change the display of null values or show dates in custom format. 

Solution:

1) Using custom data format we can specify the custom formatting of columns used in an analysis. This formatting will be applied in report’s tables and pivot tables. To edit a data format for a given column, right click on it and choose Column Properties.

2) Click on Data Format tab and check Override Default Data Format. Select Treat Number As Custom from the list.



3) Now wrt your requirement , type the below examples in "Custom Numeric Format" tab:

a) We can display the values in thousands with K (kilo) letter
     #,#.0,K
 b) Values in millions with M
    #,#.0,,M
c) Values in billions with B
     #,#.0,,,B
d) Add a currency symbol
    £# or $#

How it works is:

‘#’ is a number sign indicating significant digits.
‘#,#’ adds a comma separator for thousands.
‘.0’  indicates the number of decimal places (‘0’ for round number, ‘.0’ for one decimal place, ‘.00’ for two, etc.).
‘,’ is a thousands separator (‘,’ for thousands; ‘,,’ for millions, ‘,,,’ for billions etc.).
‘K’,’M’,’B’, ‘$’,‘£’ are characters that can be added after or before the number mask.

The syntax for custom data formatting for numeric values is:

positive value mask ; negative value mask ; null mask
If we specify the mask without semicolon, the changes will apply to both positive and negative values.

Dealing with null values in numeric fields

Using Custom Data Format we can also specify what should be shown instead of null values, ie we can replace Null values with  '0', 'No data' or 'N/A' .


1) For showing zeros (0) instead of nulls, use the below syntax:

    #,##0;-#,##0;0

(which can be read as: number with one decimal place for a positive value, minus sign (-) and number with one decimal place for a negative value, zero (0) for a null value)
The null values will be replaced with zero.

 2) Replace Null with custom text like ‘Not available’ or ‘No data’ or  '-':

 #,##0;-#,##0;no data

#,##0;-#,##0; -

Our pivot table now shows something other than null values.

Dealing with null values in text fields

For text values the syntax for custom text format is non-null value mask, null value mask.
Set Custom Text Format to: @;No description
The null values will be replaced with ‘No description’ text.




 Cheers :)