6 Replies Latest reply on Jan 27, 2017 9:54 AM by Natalia Alcassa

# Problems with annual growth

I make a tree map with regions, but I need to show my value in 2016, the annual growth in 2015-2016 and my value in 2015. But, In size I'll have just 2016. this is possible?

• ###### 1. Re: Problems with annual growth

hi Natalia,

So hopefully I've understood what you are after...let me know if not!

So in the attached, I've brought year onto the column shelf so we can calculate the YoY (using Tableau's quick table calculation)...we can then "hide" the 2015 Tree-map (so it doesn't show, but Tableau still has access to the data to perform the YoY). In the attached I've not hidden 2014 so you can see what's going on). We could make this more dynamic (i.e. you wouldn't need to change what's hidden next year!) with a table calc filter, but don't want to over-complicate things here.

There are also other ways to do the same thing.

Hope that helps and makes sense.

1 of 1 people found this helpful
• ###### 2. Re: Problems with annual growth

Thank you Simon.

I did that, but (in your exemple) I need to show the value of 2014 on tree map (2015). Do you know if it's possible?

1 of 1 people found this helpful
• ###### 3. Re: Problems with annual growth

Just so I'm clear...

You only want to show tiles for 2015, and the colour should be the YoY for 2015 vs 2014, but the Size of the 2015 tiles should be based on 2014 Sales? (or that you want the Size on 2015, but have the 2014 value as text?)

Any combination of the above is possible...just will depend on which method is best depending what you want!

1 of 1 people found this helpful
• ###### 4. Re: Problems with annual growth

The second option!

Thats right! I tried to use FIXED in 2014 (in this case) but doesn't work. Tableau get the value of the respective year.

Size: 2015

Text: 2014 AND 2015

Color: Regions

• ###### 5. Re: Problems with annual growth

So we could do this is Table Calcs, and although more efficient (in process time) is a little complicated...unless your data is very large you'll barely notice. So I've used LoDs. This is also dynamic so will always show the last 2 years info, without any manual maintenance.

So first I create a LoD to grab the last year

[Max Year in Data]

{MAX(YEAR([Order Date]))}

then I use this to create separate fields for This Year's sales and Last Year's sales...

[Sales This Year]

IIF(YEAR([Order Date]) = [Max Year in Data],[Sales],NULL)

[Sales Last Year]

IIF(YEAR([Order Date]) = ([Max Year in Data]-1),[Sales],NULL)

and then use an aggregate of this to create the YoY

[Sales - This Year vs Last]

SUM([Sales This Year])/SUM([Sales Last Year])-1

and once they are all separate, it all becomes much easier!

1 of 1 people found this helpful
• ###### 6. Re: Problems with annual growth

That's exactly what I need.

Thank you very much!