How to split the text in a variable to a different variable(s) in a Statistica Spreadsheet?

How to split the text in a variable to a different variable(s) in a Statistica Spreadsheet?

book

Article ID: KB0076063

calendar_today

Updated On:

Products Versions
Spotfire Statistica All supported versions

Description

For this example, we will consider a Variable named "Generic " in Statistica that has inputs as shown below:

User-added image
This article explains how this variable be split to populate other variables such as Device type, Model and Make that may be useful for analysis.

 

Issue/Introduction

How to split the text in a variable to a different variable(s) in a Statistica Spreadsheet?

Resolution

For splitting the variable by delimiter, we are going to use a Text function in Statistica named Word. The parameters and description of this function can be found in the function browser in Statistica:

User-added image

Double click on the variable Device Type and define the formula =Word(1,Generic,",") as illustrated below:

User-added image

Similarly, the variable Specific device=Word(2,Generic,","), which would give us the 2nd portion of the Split with , as the delimiter. 
Model can be defined with formula =Word(3,Generic) and the make can be split with formula =Word(2,Generic) where space is used as the delimiter.

Attached workspace contains the above formulas used in "Transformation of Variables" node where the formulas can be defined at one go and can also be made part of a bigger workflow.
User-added image

The example in the workspace also illustrates how existing variables can be calculated (such as Device Type, Specific device, Model) as well as how a new text variable can be defined on the go by the Transformation of Variables node.

 

Attachments

How to split the text in a variable to a different variable(s) in a Statistica Spreadsheet? get_app