Sort Order of String Field Changes in Published View Resulting in Broken Table Calculation

Published: 22 Mar 2018
Last Modified Date: 04 Nov 2019


A view using a table calculation based on a string field, which contains numerical values [0,1,2], breaks after publishing.


  • Tableau Online
  • Tableau Server 10.5+


Follow one of the options outlined below:

Option 1

Use a different Sort by order other than Data source order for the string field.
  1. Right click the field used in the view and select Sort
  2. In the Sort dialog window change the Sort by order to either Alphabetic, Field, or Manual and click Apply.

Option 2

Convert the string field data type into a number.
  1. Right clicking the field used in the view and select Change Data Type.
  2. Choose Number and click Apply.

Option 3

Create a calculated field.
  1. Go to Analysis > Create Calculated Field.
  2. Use the Int() function to convert the string field into an integer.
  3. Replace the string field used in the view with the new calculated field.  


The Hyper data engine does not guarantee the order stability of unordered strings. Hyper may dynamically change the sort order of unordered strings for performance reasons. For example, a broken table calculation will materialize, if the string sort order changes from [0,1,2] to [1,2,0].
Did this article resolve the issue?