Of course! Adding a tooltip to a metric in an Oracle Analytics Cloud (OAC) report is a great way to provide more context to your users without cluttering the main visualization.
The method depends on whether you are working in a Data Visualization (DV) Project or a Classic Analysis/Dashboard. I'll cover both, as "OAC report" can refer to either.
Method 1: In a Data Visualization (DV) Project (Recommended & Easiest)
This is the modern and most intuitive way to add tooltips in OAC. DV projects use a "Grammar Pane" where you can drag and drop data elements to build your visualization.
The key is the dedicated Tooltip channel in the Grammar Pane.
Step-by-Step Guide:
-
Open your DV Project and select the visualization (e.g., a bar chart, line chart, or map) you want to modify.
-
On the left-hand side, you will see the Grammar Pane. It has different "channels" or "drop zones" like Values (Y-Axis), Category (X-Axis), Color, etc.
-
Locate the channel named Tooltip.
[image: OAC DV Tooltip Channel] open
-
From your data panel on the far left, drag and drop the metric or attribute you want to show in the tooltip onto this Tooltip channel.
- You can add multiple items to the tooltip. Just drag another column into the channel.
Example:
Let's say you have a bar chart showing Total Sales by Product Category.
- Values (Y-Axis):
Total Sales
- Category (X-Axis):
Product Category
By default, hovering over a bar will only show the Product Category and the Total Sales for that category.
Now, you want to add the Number of Orders and the Average Discount to the tooltip.
- Action: Drag the
Number of Orders metric from your data panel into the Tooltip channel.
- Action: Drag the
Average Discount metric into the Tooltip channel as well.
Result:
Now, when a user hovers over the "Technology" bar, the tooltip will display:
- Product Category: Technology
- Total Sales: $500,000
- Number of Orders: 1,200
- Average Discount: 8.5%
Method 2: In a Classic Analysis (the "Answers" interface)
In Classic Analyses, you don't have a simple drag-and-drop tooltip channel. The most common and powerful method is to use a bit of HTML within the column formula.
Step-by-Step Guide:
This method involves wrapping your display value in an HTML <span> tag with a title attribute. The title attribute is what browsers render as a tooltip on hover.
-
Open your Analysis for editing in the "Criteria" tab.
-
Find the metric column you want to add a tooltip to (e.g., Sales).
-
Click the gear icon for that column and select Edit Formula.
-
In the Column Formula editor, you will modify the formula to include HTML. The general syntax is:
' <span title="' || "Column for Tooltip Text" || '">' || "Column for Display Value" || '</span>'
'...' : Single quotes define a text string.
|| : This is the concatenation operator in OAC.
"Column for ..." : This is a reference to another column in your subject area.
-
Apply the formula. Let's say you want to display Sales but show Transaction Count in the tooltip. Your formula for the Sales column would become:
' <span title="Transaction Count: ' || CAST("Facts"."Transaction Count" AS CHAR) || '">' || CAST("Measures"."Sales" AS CHAR) || '</span>'
- Note: You often need to
CAST numerical or date columns to CHAR (character/text) to concatenate them properly.
-
CRITICAL STEP: You must tell OAC to render this text as HTML.
- After saving the formula, click the gear icon for the same column again and select Column Properties.
- Go to the Data Format tab.
- Check the box for Override Default Data Format.
- In the Treat Text As dropdown, select HTML.
[image: OAC Classic HTML Format] open
- Click OK.
-
Go to the Results tab to see your work. When you hover over the sales value in your table or chart, the tooltip you defined will appear.
Advanced Classic Example (Multiple values in tooltip):
You can concatenate multiple fields for a richer tooltip. Use <br> for line breaks (you might need to use the character code for line breaks within the title attribute).
' <span title="Orders: ' || CAST("Facts"."Order Count" AS CHAR) || ' Customers: ' || CAST("Facts"."Customer Count" AS CHAR) || '">' || CAST("Measures"."Sales" AS CHAR) || '</span>'
This would create a tooltip with two lines: one for the order count and one for the customer count.
Summary and Best Practices
| Feature | Data Visualization (DV) Project | Classic Analysis |
|---|
| Method | Drag-and-drop to Tooltip channel | Edit column formula with HTML |
| Ease of Use | Very Easy | Moderate (requires formula/HTML knowledge) |
| Flexibility | Good | Excellent (full HTML control) |
| Recommendation | Use this for all new reports. | Use for maintaining or enhancing legacy reports. |
Best Practices:
- Keep it Concise: Don't overload the tooltip with too much information. It should provide quick, glanceable context.
- Be Informative: Use the tooltip to answer the user's next logical question (e.g., "This sales number is high, but how many transactions was it?").
- Create Calculated Items: If the exact text you want doesn't exist as a column, create a new calculated item in your DV project or use a formula in your Classic Analysis.