JP Lee Posted March 19, 2014 Share Posted March 19, 2014 Using the v4.0.3 client. I cannot seem to get a valid custom expression containing a column name stored in a Document Property to work for the error bars on my bar chart. The document property is a column name (String). I rt-click on the column for the error bar, and select Custom Expression. In the Custom Expression builder, I (naively) create the following: StdDev ( DocumentProperty("ColumnName" ) I try to "enclose" it in ${ and }, but no luck there either. I try using [ and ], but nope. I try both together, and still no luck.It seems like in the Error Bar dialog, that custom expressions containing Document Properties do not return the text string. Anyone know how to make this work thx, JP Link to comment Share on other sites More sharing options...
Manoj Chaurasia Posted March 19, 2014 Share Posted March 19, 2014 Thanks, but I did try that, without success: StdDev ( [${DocumentProperty("ColumnName")}] ) The resulting expression is undefined - in the Custom Expression dialog: StdDev([undefined]) I think there's something about the DocumentProperty() insert that does not work in this case / context. When I strip out the DocumentProperty() wrapper, meaning I make the Expression: StdDev ( [${ColumnName}] ) The resulting expression in the dialog is correct, but I then get an error box stating "Preprocessor syntax is not supported". That's a big help. So, any other advice greatly appreciated! JP Link to comment Share on other sites More sharing options...
Manoj Chaurasia Posted March 20, 2014 Share Posted March 20, 2014 StdDev(${colName}) works for me in 5.0 if my colName document property contails my "sales" column. Check if you actually have a ColumnName property in your document properties (edit/document properties/properties) When you don't have such property or you delete it, then you get StdDev(undefined) Link to comment Share on other sites More sharing options...
Manoj Chaurasia Posted March 22, 2014 Share Posted March 22, 2014 Just checking, does your column you are passing to the expression contain valid data for performing a standard deviation calculation Link to comment Share on other sites More sharing options...
Manoj Chaurasia Posted October 23, 2015 Share Posted October 23, 2015 You have to use both types of brackets. [${PropertyName}] the ${ } tells Spotfire to put the value of the document property in its place The [ ] then are used the same way you would to call out any other column Link to comment Share on other sites More sharing options...
JP Lee Posted October 23, 2015 Author Share Posted October 23, 2015 And I get the same results in v5.5 client. Link to comment Share on other sites More sharing options...
JP Lee Posted October 23, 2015 Author Share Posted October 23, 2015 No dedicated "ColumnName" property - I added one for my dynamic column name. That part works fine. If I hardcode a column name (so it does not change with markings), the StdDev computes fine. I sent this example along to TIBCO support, and it is indeed a defect, and they added me to the "list". So maybe someday it gets fixed. Not holding my breath. Scripted my way around it. Thanks for the suggestions. JP Link to comment Share on other sites More sharing options...
Andrew Birnberg Posted September 4, 2019 Share Posted September 4, 2019 Although this is a very old issue, I encountered the same thing today using Spotfire 7.8. The problem appears to be that the error bar widget doesn't allow "preprocessor" syntax in custom expressions. In order to get around this, I ended up creating a calculated column based on the column name stored in my column drop down menu. I was then able to use the calculatedcolumn in the custom expression for my error bars. The calculated column updates itself whenever you change the associated propertyin the drop down menu. Link to comment Share on other sites More sharing options...
Randi Cowin Posted March 16, 2020 Share Posted March 16, 2020 @birnbera - how did you do this Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now