2 Replies Latest reply on Jan 12, 2018 5:30 PM by Yuriy Fal

    COVAR and VAR return 0 when using a time dimension in Detail or Label

    William Graham

      i need to create a scatterplot and express the slope of the trend line in the title

      i use the approach identified in : Covariance, Trend Lines, Correlation Coefficient R and R-Squared

       

      if i pre-aggregate the data, in the native excel file, the following formula returns a valid slope (See "pre-aggregated" worksheet in attached)

      WINDOW_COVARP(SUM([Hours]),SUM([Tics]))/WINDOW_VARP(SUM([Hours]))

      BUT only if i do not include the Month dimension on the Mark card (detail or label).

      if i do, slope expresses as "None" and the COVAR and VAR return as 0.

      my work-around is to duplicate this as a dual axis, and use the second axis for Month labels.

       

      if i do not pre-aggregate the data and simply use the raw, tableau requires the Month dimension to appropriately segment the data (See "from raw" worksheet in attached).

      and i get the result of COVAR and VAR = 0 and slope = "None"

       

      is this a user-error?