KNOWLEDGE BASE

Error "The result returned by the SCRIPT function is of an unexpected type" When the Result is NA


Published: 25 Oct 2020
Last Modified Date: 10 Nov 2020

Issue

When using SCRIPT_REAL in a calculated field, and the result of the calculation in the script is NA, the following error may occur:

Unable to complete action
The result returned by the SCRIPT function is of an unexpected type.

Environment

  • Tableau Desktop 2019.4 and newer
  • RServe analytics extension

Resolution

 Instead of using 'NA' in the calculation, use 'NA_real_'. 

Cause

This behavior is by design, since NA_real_ is of the expected type when using the SCRIPT_REAL() function.
 
Did this article resolve the issue?