KNOWLEDGE BASE

Error: "Cannot ORDER BY literal values" When Using a Tableau Parameter in a ORDER BY Clause of a Custom SQL Query


Published: 09 Mar 2017
Last Modified Date: 10 Mar 2017

Issue

When attempting to use a Tableau Parameter in a ORDER BY clause of a custom SQL query connecting to Google BigQuery, then the following error might occur in Tableau Desktop: 
Cannot ORDER BY literal values

Environment

  • Tableau Desktop
  • Google BigQuery

Resolution

Use a field in the ORDER BY clause instead of a parameter.

Note: writing or modifying specific Custom SQL queries to achieve a desired effect is outside the scope of Support. Every data source has a slightly different SQL syntax and assistance from a qualified resource such as your Database Administrator is recommended when utilizing the custom SQL option.

Cause

The Tableau parameter only ever returns one value, rather than a list of values like a field. Google BigQuery requires a field in the ORDER BY clause. Please see the Google documentation Query Reference for more information.
Did this article resolve the issue?