14.03.2014 Views

Download Jmp User Guide

Download Jmp User Guide

Download Jmp User Guide

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

300 Formula Editor Chapter 9<br />

Using Functions<br />

Adding Character Arguments and Returning Character Strings<br />

You can create a formula that accepts character arguments or returns character strings and converts the<br />

data type of a value from numeric to character, or character to numeric. When you create these<br />

formulas, note that:<br />

• Character functions can result in either character or numeric data. If you calculate a data type<br />

different from the one specified, the data type of the computed column is automatically changed to<br />

match the result.<br />

• Arguments that are literal character strings must be enclosed in quotation marks.<br />

To build a formula that contains a character function or returns character strings<br />

1 Open the formula editor by right-clicking a column name in the data grid and selecting Formula.<br />

2 Select an expression in the formula editing area by clicking it. (It is selected when there is a red<br />

outline around it.)<br />

3 Click the menu on the function browser and select Character, as shown in Figure 9.11. The<br />

character functions now appear in the list below the menu.<br />

Figure 9.11 Select Character from the Function Browser List<br />

4 Select which function to insert in the formula. For descriptions of each function, see “Character<br />

Functions,” p. 460.<br />

See “Using the Munger Function,” p. 324, for an example.<br />

Matching Character Patterns<br />

You can create a formula that uses pattern-matching on character strings. Pattern matching is a flexible<br />

method for searching and manipulating strings, and regular expressions are also supported. When you<br />

create these formulas, note that:<br />

• First, you define a pattern with one more of the character patterns.<br />

• Then, you use Pat Match to compare a string to the pattern.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!