Data Viz Done Right

February 27, 2018

Tableau Tip Tuesday: Using LOD Expressions to Return the First & Last Values in a Densified Data Set

No comments
On the Makeover Monday Week 9 2018 Help Discussion on data.world, Lindsay Betzendahl posed the following question:
I'd like to get the difference from the first to last year for each country regardless of what year that is. When I use difference from first or a lookup, I get incorrect values for the countries that have a later year start than the others. I tried some LOD calcs, but that didn't seem to work either. Any help is appreciated!
This week's tip walks you through tackling this problem. In particular, how do you do three things?

  1. Ignore years that have no values but a year exists
  2. Return the value from first and last years where data exists
  3. Compare the first and year to look at the change

The video and example below demonstrate the solution I came up with. Enjoy!

No comments

Post a Comment