KNOWLEDGE BASE

"ERROR 3459: Function <fx(unknown)> is not unique" Using Calculated Field with Parameter


Published: 19 May 2016
Last Modified Date: 29 Sep 2017

Issue

When using a calculated field with a parameter, the following error occur sif the parameter is set to a value that is not contained in the calculation: 

ERROR 3459: Function SUM(unknown) is not unique HINT: Could not choose a best candidate function. You may need to add explicit type casts.

For example, if you have a calculation similar to the following: 

SUM( CASE [parameter] 
WHEN 1 THEN x 
WHEN 2 THEN y 
WHEN 3 THEN z 
END) 

And a parameter with values 1, 2, 3 and 4, if the parameter is set to 4, the error will occur.

Environment

  • Tableau Desktop 
  • Vertica

Resolution

Use one of the following workarounds:
  • Add a final 'ELSE' clause to the CASE statement 
  • Edit the parameter to only contain values that are present in the calculation 
  • Wrap the [parameter] in the calculated field in INT()

Cause

Vertica is unable to evaluate the [parameter] because the value does not exist in the calculation.
 
Did this article resolve the issue?