3 Replies Latest reply on Mar 2, 2017 10:19 AM by Yuriy Fal

# Why does this table calc change behavior when dimension moved from detail to columns?

When trying to make a simplified version of Andy Kriebel's excellent trellis example. http://www.vizwiz.com/2017/02/ww7.html, I ran into a weird hurdle, where moving a dimension from one shelf to another changes the way the row and column table calcs behave (even though the compute using and sort order is fixed).

It appears that the index() function is returning the wrong value in some cases. Or at least a different value that I would expect. Can anyone explain why? Is this a bug?

See the attached workbook.

• ###### 1. Re: Why does this table calc change behavior when dimension moved from detail to columns?

Hi Alex,

This is a not-so-well-documented behaviour

of Table Calculations when At the Level is in play.

In your case there is another layer of complexity

because of Data Densification (or rather the absence of it) --

please check the # of Marks on the heatmap2 view (784)

as opposed to the other ones (740 -- no densification).

Luckily, there is the man who wrote the Bible on the very topic --

calling Jonathan Drummey and referring to his 2-Part article:

At the Level – Unlocking the Mystery Part 1: Ordinal Calcs | Drawing with Numbers

At the Level – Unlocking the Mystery Part 2: Rank Functions | Drawing with Numbers

To add my 2c, please find the attached with Sheet 7

(using the recipe from the Part 2 of the above).

Yours,

Yuri

1 of 1 people found this helpful
• ###### 2. Re: Why does this table calc change behavior when dimension moved from detail to columns?

Yuri,

Thanks a lot for the help. I had read through Jonathan's in depth discussion before on level of detail, but missed the part at the end of the first article where he explains how domain padding acts differently when dimensions are on the detail shelf instead of rows, columns or pages. That turned out to be the critical distinction here.

Here is the relevant quote from Jonathan's article:

"if the dimension used for At the Level (or any addressing dimensions above it) are on the Level of Detail Shelf while other addressing dimensions are on Rows, Columns, and/or Pages, Tableau triggers domain completion for those addressing dimensions."

"Another [way] to prevent unwanted domain completion is to put all your addressing dimensions on the Level of Detail Shelf, and use discrete measures such as ATTR(myAddressingDimension) to generate the proper headers."

A well respected zen master responded that he now tries to pad out his data in advance of using Tableau to avoid these kind of domain padding issues.

This is the diagram that made the behavior (almost) clear to me at the end.

Alex

• ###### 3. Re: Why does this table calc change behavior when dimension moved from detail to columns?

Alex, glad it helps.

Frankly, credits should go to both Joe and Jonathan.

And I'd like to refer to the live session (recorded by Joe

together with Matt) -- more than two years ago,

but still relevant, fresh and inspirational:

Yours,

Yuri