Jump to content

Using document property inside of aggregate function


Spotfire Support 2

Recommended Posts

I'm trying to use a document property to control whichcolumnfrom a data table is used as the first argument for the "aggregate" function, but am unsuccessful doing so. The script is workingfine when I use the actual column names, but when I attempt to use the document property as column name, the function returns "no rows to aggregate". Examples below.

 

Successful script: aggregate(Table$Column1, by = list(Table$Column2), FUN = median, na.rm = TRUE)

 

Unsuccessful script: aggregate(Table$DocProperty, by = list(Table$Column2), FUN = median, na.rm = TRUE)

DocProperty is a string and currently holds the value "Column1".

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...