Create the calculated fields
One will indicate if DNKN stock is worth less than SBUX, the other if it is worth more.
1. Right-click in white space in the data pane and select "create calculated field." Name it “negative price difference.”
2. Enter the formula: IF [Price difference]
You can drag out the field Price difference rather than type it, if desired.
The output for the ELSE option is just two double quotes with nothing inside. That means nothing will show if the condition isn't true.
3. Create another calculation the same way, but name it Positive Price difference and enter the formula:
IF [Price difference] > 0 THEN "more" ELSE "" END
(Refer to this Knowledge Base article for more information.)
Build the tooltip
4. Drag all relevant fields not already in the view to the tooltip shelf (Company, Positive Price difference, Negative Price difference, Price difference).
5. Click on the tooltip shelf to bring up the editor. Clear the default text.
6. Using the insert button in the upper-right corner, insert the relevant fields. The key step here is to insert both “Positive Price Difference” and “Negative Price Difference” right next to each other. Only one can be true at a time; the calculation that is not true will display nothing (because of the empty double quotes "").
7. Type the surrounding text and format as desired. (Refer to this Knowledge Base article for more information.)
The tooltip could look like this:
Depending on the value of the Mark, only one option will show: