Search code examples
obiee

OBIEE Pie graph - How to always display both actual and percent values?


I've created a pie chart and can see the data labels on rollover. On rollover, l can see the actual and percent values together, but after changing the data label display property from "on rollover" to "Always", It only shows me either the actual or the percent values.

How can I show both the actual and the percent values in the "Always on" data labels?

I've tried to adapt the xml, but I don't know the correct way to do so.


Solution

  • Here is a trick to show both...

    But if you want a Legend, you must include the entity Names before the value and percent. The result will be that the pie values will have both the entity/grouping name, actual value (because now, for OBIEE, its part of the enitity name) and the percent.:


    First, you must enter the graph properties of the Pie Chart:

    1. Graph Properties (Click the xyz icon at the top-right of the Graph view in the Results tab).
    2. Click Titles and Labels > Data Markers > Display
    3. Ensure that Show Data Labels is set to Always.
    4. Ensure that Display is set to Name and value.
    5. Ensure that Change Value is set to Percentage of total.
    6. Click OK > OK.


    Now create a concatenated column and add it to the Pie chart (credit to Miky Schreiber's blog):

    1. Add a new column (call it "concat").
    2. Edit the new column's formula to be the concatenation of the entity--that the pie chart groups/slices by--and its measure value.
      • This is a string column, so you’ll need to convert the measure into string. It will look something like this:
        • LOGICAL_TABLE.ENTITY_NAME || ' ' || cast(FACT_TABLE.MY_MEASURE as char)
    3. Select the checkbox Treat as an attribute column > Click OK.

    4. Now Edit the graph/pie view and in the Layout editor, drag the concat column under Slices and drag the measure under Slice Size. Optional: Select the checkbox Show in Legend.

    5. Save your changes.