4 Replies Latest reply on Nov 24, 2017 5:20 AM by Anusha Chimmili

    Blended data sometimes aggregates differently for line/area chart vs. other charts?

    Jamieson Christian

      [Tableau Desktop 10.1.3 (10100.16.1223.0056) 64-bit on Windows 7]


      I ran into a very odd phenomenon this week when attempting to blend 2 data sources on date information. Specifically, the blended data aggregates differently if I select a Line or Area Chart versus some other chart type (Bar, Square, Circle, Shape, or even Text).


      I created a Superstore sample to illustrate the behavior. This is hardly a realistic example (I'm blending 2 copies of Superstore), but it illustrates several key characteristics of the project I am working on:


      • Primary data source has a Date field ("Order Date" in this example), which is used as a discreet Month measure in the view.
      • Secondary data source has Order Date represented as separate Year and Month fields. (I created calculated fields "Fiscal Year" and "Fiscal Month" on my secondary Superstore example to simulate this.) The Month field is a number 1–12.
      • Primary data source has a computed field "Order Month" = MONTH(Order Date) that yields a number to use in blending. Blending on MONTH(date) directly doesn't work because MONTH(date) in this context seems to yield a month name and not a number (so the blending fails).
      • The data relationship, then, is YEAR(Order Date) => Fiscal Year and Order Month => Fiscal Month


      Tab "Blending fails" in the attached sample shows how this blending behaves when using a Bar Chart (top) and a Line Chart (bottom). The bar chart blends on both Fiscal Year and Fiscal Month just fine, but the line chart seems to ignore the Fiscal Month relationship and blends only on Fiscal Year. As a result, the aggregation is the same for all 12 months (it aggregates the entire year's worth of data).


      Blending fails.png


      WORKAROUND: Create a calculated field "Fiscal Date" in the secondary data source, which simply compiles Fiscal Year and Fiscal Month into a date field. Then I can blend on MY(Order Date) => MY(Fiscal Date) and the aggregation will work properly no matter what chart type I select. See tab  "Blending workaround" in the attached sample; it differs from "Blending fails" only in terms of which data relationships it uses for blending.


      My question, then, is not how to fix or work around this — I figured that part out. But I cannot for the life of me comprehend why the data blending would behave differently based solely on the chart type that was selected. I thought I had data blending figured out, but this behavior has me stumped. Can someone help me understand what's going on under the hood in this scenario?