Content_Cut_Icon Twitter_Brands_Icon

A developer’s guide: Value_Is_String

Mode_Comment_Icon_white0
Alarm_Icon_1_white2 min
Book_Open_Solid_Icon
Executive Summary Key Takeaway in 30 Seconds

Value_Is_String is a special, reserved local variable used internally by TurboIntegrator scripts. It is not necessary to explicitly declare or assign it within your script; TM1 automatically manages its value during data processing.

Value_Is_String is a special, reserved local variable used internally by TurboIntegrator scripts. It is not necessary to explicitly declare or assign it within your script; TM1 automatically manages its value during data processing.

Purpose of Value_Is_String

The main role of Value_Is_String is to determine whether the data source value being processed is a string or a number. This helps in scenarios where different operations are needed depending on the data type, such as:

  • Formatting output differently

  • Validating data

  • Applying specific calculations or conversions

How does Value_Is_String work?

  • When the data source value is a string, Value_Is_String returns 1.

  • When the value is a number, the variable returns 0.

This binary indicator makes it straightforward to write conditional logic in your scripts.

Usage in scripts

Since Value_Is_String is a reserved variable, you don’t need to declare it. You simply check its value to determine the data type:

Value_Is_String = N;

  • If N equals 0, the cell contains a numeric value.

  • If N equals 1, the cell contains a string.

Example:

Value_Is_String = 0;   // Check if the value is a number
If (Value_Is_String = 1);
   // Handle string data
Else;
   // Handle numeric data

EndIf;

Practical Applications

Suppose you are importing data where some cells contain text, and others contain numbers. Using Value_Is_String, you can craft logic to process each type correctly:


Value_Is_String = N;

If (Value_Is_String = 1);
   // Process string data
Else;
   // Process numeric data
EndIf;

This ensures your script handles each data type appropriately, avoiding errors or misinterpretations. ### Summary - `Value_Is_String` is a built-in, reserved variable in TurboIntegrator. - It automatically indicates if the current cell data is a string (`1`) or a number (`0`). - It simplifies data type detection, making your scripts more robust and flexible. - No need to define or assign it manually; just check its value in your logic. ### Final Thoughts Using `Value_Is_String` effectively can streamline your data processing workflows in TurboIntegrator, especially when dealing with mixed data types. Understanding this variable helps you build more intelligent scripts that adapt dynamically to the data they process.

Talk to us: media@octanesolutions.com.au

Baburao G
Written by

Baburao G

Subject-matter specialist at Octane Solutions, helping Australian enterprise finance teams optimize planning, analytics, and automation.

Leave a comment

Got a question? Shoot!

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Get more articles like this delivered to your inbox