KNOWLEDGE BASE

Redshift - marks not aggregating or stacking


Published: 24 Oct 2017
Last Modified Date: 13 Dec 2017

Issue

When certain fields from a Redshift connection are used as a dimension to create a view with [Number of Records] as the measure, the marks do not stack or aggregate. Instead the marks seem to be just layered on top of each other as if aggregation and stacking were disabled in the Analysis menu.

Environment

  • Tableau Desktop 10.3.2
  • Amazon Redshift

Resolution

Workaround 
  1. Create a calculated field to wrap [Analytics Id] in a TRIM() function 
  2. Use the calculated field instead of the original dimension when building views
This issue might also be resolved by modifying the table in Redshift in one of two ways:
  1. Remove any duplicated values from the primary key field
  2. Use an actual unique field as the primary key or no primary key at all

Cause

This issue may be caused by a field in the database table that is designated as a primary key, but that same field has non-unique values in it.

The non-unique values make a GROUP BY clause necessary when the table is queried, but the primary key designation causes that GROUP BY clause to be automatically removed.
Did this article resolve the issue?