VizWiz

Launch, grow, and unlock your career in data

June 21, 2016

Tableau Tip Tuesday: Using LOD Calcs for Year over Year Comparisons

4 comments

For this week’s Tableau Tip Tuesday I show you how to use Level of Detail expressions to get the latest year and prior year and then compare then to create visual alerts.

4 comments :

  1. Hi Andy! thanks so much for this, it's great and just what I need. I'm trying to replicate this but when I get to the latest sales (in my case Revenue) "IF YEAR([Date])=[Latest Year ] Then [Revenue Ex Hedge] ELSE 0 END"
    It shows an error message of mixing aggregated and not aggregated arguments in the Year=Latest year and in the IF function.

    Any idea what am I doing wrong?

    Thanks so much!
    Ariela

    ReplyDelete
    Replies
    1. If your Revenue Ex Hedge field is an aggregate then the Year([Date]) and Latest Year need to be aggregates too. The easiest thing would be to make the revenue field a non-aggregate.

      Delete
  2. Hi Andy, I have same problem as Ariela. I am trying to calculate YTD on a aggregated measure. I get the error "cannot compare aggregated and non-aggregated values". If I non-aggregate my measure I don't get the desired results.

    Thank you,
    Vishi

    ReplyDelete
    Replies
    1. Vishu, you likely need to break up your aggregate calc into parts that each separately calc the YTD then combine them into your aggregate.

      Delete