top of page
Heena Nazeer

Why FIXED Level of Detail Expressions are preferred?

One of the prominent characteristics of the tableau is the Level of Detail expressions (also called as LOD expressions). The LOD expressions allow the user to compute values at the data source level or row-level and the visualization level or view-level depending upon the levels of granularity of a dataset. Irrespective of what the user specifies in the row (measures) and column (dimensions) shelf, one can master the result output with the help of calculated fields even by ignoring one or more entities in the view.


Row-Level Expressions

The dimensionality of expression is called row-level, when the expressions referencing unaggregated data source column are computed against each row in the underlying table.


Syntax of LOD expression

A LOD/ level of detail expression has the following syntax.

{[LOD] <dimension declaration >: <aggregate expression >}


Types of LOD Expressions

The three different types of level of detail expressions in tableau are

  1. INCLUDE

  2. EXCLUDE

  3. FIXED

INCLUDE LOD Expressions

INCLUDE as the name suggests, computes values using the specified dimensions in the calculated field in addition to the dimensions in the view (pages, marks, rows, columns, sheet).

INCLUDE level of detail expression is used when the user wants to calculate values at a lower level of granularity.

The syntax for INCLUDE LOD Expressions:

{[INCLUDE] <dimension declaration >: <aggregate expression >}


EXCLUDE LOD Expressions

EXCLUDE level of detail expressions is used to omit specified dimensions from the aggregate expressions.

EXCLUDE level of detail expressions is used when the user wants to calculate the dimensions from the higher level of granularity eliminating the dimensions from lower levels of granularity which is present in the view.

The syntax for EXCLUDE LOD Expressions:

{[EXCLUDE] <dimension declaration >: <aggregate expression >}


FIXED LOD

FIXED level of detail expressions computes a value using the specified dimensions, without reference to the dimensions in the view.

FIXED level of detail expressions ignores all the filters in the view except context filters, data source filters, and extract filters.

The syntax for FIXED LOD Expressions:

{[FIXED] <dimension declaration >: <aggregate expression >}


Illustration on different types of LOD Expressions



Image Courtesy: Unsplash.com


Here I have considered the Sepsis dataset and studied the Heart Rate (HR) of random patients who fall under two different age groups i.e., teenagers (14yr –16 yr) and elderly people (61,68,70 yr, etc.,)

Considering


1. INCLUDE Level of Detail Expressions


Calculated field used: { INCLUDE [Age (group)]: MAX([HR])}



Chart 1: Analysis of Heart Rate (HR) considering INCLUDE LOD


It is pretty much visible from the chart 1., that, though I have considered only “Age (group) and Maximum of HR” in my calculated field. In addition to the maximum HR value INCLUDE Level of Detail Expressions also computed the Heart rate for Patient ID which is added to the view, which clearly proves that any changes to the dimension of the view will alter the results.


2. EXCLUDE Level of Detail Expressions


Calculated field used: { EXCLUDE [Age (group)]: MAX([HR])}


Chart 2(a): Analysis of Heart Rate (HR) considering EXCLUDE LOD


From chart 2 (a) tableau is returning only the overall maximum Heart Rate neglecting the age group by using EXCLUDE Level of Detail Expressions.



Chart 2(b): Analysis of Heart Rate (HR) considering EXCLUDE LOD with Patient ID in view


However, from Chart 2(b) it is very much visible that the Heart Rate is changed from displaying the overall maximum value to individual values with respect to the Patient ID, since there is an addition of Patient ID in the view.


3. FIXED Level of Detail Expressions


Calculated field: { FIXED [Age (group)]: MAX([HR])}


Chart 3(a): Analysis of Heart Rate (HR) considering FIXED LOD


From Chart 3(a) it is inferred that tableau returns the maximum Heart Rate with respect to the corresponding age (group) with the use of FIXED Level of Detail Expression.



Chart 3(b): Analysis of Heart Rate (HR) considering FIXED LOD with Patient ID in view


From Chart 3(b) it is inferred that tableau again returns only the maximum Heart Rate with respect to the corresponding age (group) with the use of FIXED Level of Detail Expression even with the addition of Patient ID in the view. In simple terms, there is no change in the results irrespective of the specified dimensions in the view.


Hence, I would like to conclude saying that the FIXED level of detail expressions is most preferred compared to the other two level of detail expressions. In INCLUDE and EXCLUDE LOD expressions the output will be changed if there is any modification (addition or deletion of tables) in the view. Whereas, the FIXED level of detail works with respect to the formula in the calculated field and irrespective of the changes in the view, the output values or the chart will not be changed.


Hope my blog helped you to understand the importance of FIXED Level of Detail Expressions (LOD) and why it is preferred. Please do like and share your thoughts in the comments section. Happy reading!


76 views

Recent Posts

See All
bottom of page