Working with custom expressions in Spotfire can be tricky. You try different combinations of syntax and just get errors. Sometimes the error message is helpful, but often it is just jibberish. How do you know exactly what’s getting passed thru the expression? There is a way to find out. Check out this short post for a solid pro-tip on troubleshooting custom expressions in Spotfire.
Blog or Video
Troubleshooting Custom Expressions
I promised this would be short and sweet. Here’s the tip. Copy and paste your expression into the Description of any visualizations, and it will show you how Spotfire interprets it. Take this expression, for example.
Sum($esc(${ListBoxMulti}))!=0
In the menu, you see the expression, but…
…after copying and pasting it into the description…you can see exactly how Spotfire interprets it.
Here’s another example.
$map("$esc(${ListBoxMulti})!=0", " and ")
Now, these first two examples were already correct, but here’s a version of the expression above that’s wrong. I put the ” and ” in the wrong place.
$map("$esc(${ListBoxMulti})!=0 and", ",")
This is even more helpful when you use it with more than one expression. Then you can see exactly how they are interpreted differently.
Because of the description interpretation of the expression, I can see exactly how Spotfire reads the expression and can easily figure out what’s wrong. You’ll be troubleshooting custom expressions like a pro in no time!
Pingback: Spotfire Prompts to Install Over and Over » The Analytics Corner