4 Replies Latest reply on Jul 25, 2018 12:21 PM by Deepak Rai

# Seemingly simple task: Map 1 year's value; show in label another year's value

Hello all,

As a Tableau novice, I have been struggling for the past week with what appears to be a simple task: map 1 year's measure value, but show in a label/tooltip another year's value for comparison.  After poring through many KB articles and related community conversations, as well as struggling with table calculations (supposedly not the right approach since previous value is not in view) and a mix of LODs (which I gather might hold the solution but can't quite nail it), I thought I'd ask the experts here.

Simplified example of data source is as straightforward as this:

Country     Year     Population

A               2000     1,000,000

A               2001     1,100,000

B               2000     2,000,000

B               2001     2,300,000

etc.

In this over-simplified but (I think) sufficient example, I'd like to plot on a map country A's 2001 population of 1,100,000 via, say, a sized circle; but then show in a label/tooltip that country's previous year 2000 value of 1,000,000.

What I've tried so far:

- No problem mapping any given year's value for any country.  Shows sized mark for only a single chosen year for each country.

- Successfully used FIXED LOD to determine prior year - i.e., using {FIXED [Country] : MAX([Year])-1}.  That is, I can display this "Previous Year" calculated field just fine in a label/tooltip.

- But I can't for the life of me "address" this previous year's record to show its population value.

Any tips greatly appreciated - I feel as if I'm on the right track and am missing something obvious....

Sincerely - Vikram.

• ###### 1. Re: Seemingly simple task: Map 1 year's value; show in label another year's value

IF{FIXED [Country] : MAX([Year])}-1=Year Then Population END

Drag it to Tooltip

This should Work too;

{FIXED Country:MAX(IF{FIXED [Country] : MAX([Year])}-1=Year Then Population END)}

• ###### 2. Re: Seemingly simple task: Map 1 year's value; show in label another year's value

Lightning fast, too - wow!

So Deepak bear with me: this unfortunately returns no value; am I not right in thinking that we cannot compare the previous year LOD (say it returns year 2000) to the current year simply because only the current year is ever in the view?

If it helps, I'm including here a packaged workbook with a small representative sample of records, and the map as it is.

Many thanks for patience with a newbie.

• ###### 3. Re: Seemingly simple task: Map 1 year's value; show in label another year's value

And here is the workbook sample.

• ###### 4. Re: Seemingly simple task: Map 1 year's value; show in label another year's value

I Am right Now on Different version, so Could Not open your Workbook, but I tested with your data and my second Calc Works. Pl Check Screenshot, The Total for A is 110000, but Tooltip Show Previous year's value

Thanks

Deepak