string(X)

Returns the input value expressed as a text string.

Syntax

string(X)

Input

Argument Type Description
X any The value on which to apply the function

A scalar value or the name of a column

Return Value

Returns the input value expressed as a text string. If X is a number, it is converted to text.

If X is N/A, the result is N/A.

Example

In the "Monthly Statewide Seasonally Adjusted Unemployment Statistics" table (pub.fin.fred2.bls.smsa), you can create a computed column that displays the value in the column named unemp_rate expressed as a text value.

<base table="pub.fin.fred2.bls.smsa"/>
<willbe name="example" value="string(unemp_rate)" 
label="String`Rate"/>

For a value of 6.6, the result would be "6.6".

For a value of 11.0, the result would be "11".

You can create a computed column that displays the value in the month column expressed as a text value.

<note type="base">Applied to table: pub.fin.fred2.bls.smsa</note>
<willbe name="month_example" value="string(month)" label="String`Month"/>

For a value of 01/76, the result would be "197601" because the value of the underlying integer in <month> form is 197601. It is displayed as 01/76 in the table because of the display format applied to the month column.