Product: TIBCO Spotfire®
How to reverse a string value in TIBCO Spotfire Analyst, using TERR_String().
In Spotfire Analyst, if you have a Spotfire column of DataType "String" and you want to reverse the order of characters in each entry in the column, then you can use the expression provided below in the Resolution and in the attached analysis file (Filename: ReverseString.dxp).
For example, this can be used to convert the string "Apple" to "elppA".
In TIBCO Spotfire Analyst, create a calculated column that uses the following expression:
- TERR_String("output=sapply(lapply(strsplit(input1, NULL),rev),paste,collapse='')",[Column Name])
NOTE: This expression function is based on a TIBCO Enterprise Runtime for R (TERR) script, so it requires access to a TIBCO Enterprise Runtime for R statistics engine to work. TERR is included in the Professional/Analyst/Desktop Client starting in version 5.0, so there are no additional requirements for this to work in those clients. For this to work in Spotfire Web Player or Automation Services, you need to configure Spotfire to point to a TIBCO Spotfire Statistics Services (TSSS) server instance. This TSSS URL must be configured according to the TIBCO Spotfire Statistics Services Installation and Administration Manual located at the following:
- URL: https://docs.tibco.com/products/tibco-spotfire-statistics-services
- Chapter: Configuring TIBCO Spotfire to use TIBCO Spotfire Statistics Services
Comments
0 comments
Article is closed for comments.