Karim Kardous Posted September 18, 2020 Share Posted September 18, 2020 Hello, Custom expression should say: IF(${SomeRandomDocumentProp} = 'X' ,Avg([elapsed_time]) ,IF(${SomeRandomDocumentProp} = 'Y' , Sum([total_orders]) , Sum(total_spend) ) ) so i don't know how Spotfire can deal with default selection but the idea is to write a dynamic calculation in the custom expression itself. Apologies for no code but no code was really working at all. Thank you, Link to comment Share on other sites More sharing options...
Fabian Duerr Posted September 19, 2020 Share Posted September 19, 2020 Please go to Spotfire help and search for: 'Properties in expressions, general information' If you do not want the property value to be interpreted as a column name but as a literal string value, you should put the property call within quotation marks. So you should use: IF('${SomeRandomDocumentProp}' = 'X' ,Avg([elapsed_time]) ,IF('${SomeRandomDocumentProp}' = 'Y' , Sum([total_orders]) , Sum([total_spend]) ) )PS: You might want to check out CASE functions as well instead of usingmultiple IF statements 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