Recently, a colleague ran into an issue with the workbook that is exported from our Audit tool in our Workbook Tools product:
The error is Tableau Data Engine Error: 4: PrimitiveExp::MakePrimitive: map_lower_user2_val.
Findings
When I investigated, I discovered that it was caused by a bug in Tableau 9.0. In our workbook, we have a calculated field with the following formula:
CONTAINS(LOWER(IFNULL([Dashboard Name],"")), LOWER([Dashboard]))
CONTAINS(LOWER(IFNULL([Dashboard Name],"")), LOWER([Dashboard]))
Dashboard is a string parameter that we use to provide the search functionality at the top of the dashboard pictured above. The error occurs when IFNULL evaluates TRUE and the LOWER function throws the exception. If you pass a zero length string directly into LOWER, i.e. LOWER(“”), it performs as expected. It only breaks when IFNULL return a zero length string.
Workaround
My workaround in this instance was to TRIM the zero length string in the true part of the IFNULL, so the new formula became:
CONTAINS(LOWER(IFNULL([Dashboard Name],TRIM(“”))), LOWER([Dashboard]))
CONTAINS(LOWER(IFNULL([Dashboard Name],TRIM(""))), LOWER([Dashboard]))
You might be able to also use a space as the null replacement if you just need white space, making the TRIM function unnecessary. But in our instance, we needed a zero length string. I hope this helps anyone unfortunate enough to run into this bug.
Note: If you are using Workbook Tools and have ran into the issue in the Tableau workbook exported by the Audit tool, the implemented workaround will be released in version 1.7.2.