2 Replies Latest reply on Dec 12, 2016 9:21 AM by Kyle Peterman

# Trying to create a difference calculation, then conditionally display difference in a tooltip

I have a workbook that has income for groups of people.  What I'm trying to achieve is show the median income between men and women (which I've done), then calculate the difference in income between those two groups (which I've done).  Then add the "gap" to the tooltip.  I have added a conditional within my tool tip to say that a man makes "More/Less" than a woman and vice versa but I would like the tool tip to say "how much (gap amount) more/less".  Everytime I try to add the income gap calculated field to the tooltip and try to look at the tooltip on the man side or woman side the gap calculated field does not display because my hover is based on the gender so only one half of the calculated value is ever available.  I have been looking for a couple of days to see if anyone else has had this issue but I haven't found anything similar.

Any help would be appreciated.

• ###### 1. Re: Trying to create a difference calculation, then conditionally display difference in a tooltip

I would recommend a different approach. What you are trying to calculate is the difference between two values displayed in a table - a table calculation should do the trick:

[Gap] : MEDIAN([Earnings]) - LOOKUP(MEDIAN([Earnings]),ATTR(IF [***] = "Male" THEN 1 ELSE -1 END))

Compute using [***].

1 of 1 people found this helpful
• ###### 2. Re: Trying to create a difference calculation, then conditionally display difference in a tooltip

Stephen,

Thank you very much.  That did work.  I will need to read up some more on table calculations. Thank you for your help.