Built-in Functions → isAlpha

isAlpha() is a boolean function that returns true if a string value consists of alphabetic characters only, otherwise, it returns false.

Note

A string value can be uppercase or lowercase.

Signature

isAlpha(value)

Returns

boolean

The following table illustrates the isAlpha() function input value and output:

isAlpha(value)Returns
isAlpha(“PRODUCTCATEGORY”)True
isAlpha(“productcategory”)True
isAlpha(“ProductCategory”)True
isAlpha(‘ProductCategory’)True
isAlpha(“Product Category”)False
isAlpha(“Product_Category”)False
isAlpha(“ProductCategory123”)False
isAlpha(“123”)False
isAlpha(“abc123”)False
isAlpha(“!@#”)False

Example

Determine which items in the Product Category consist of alphabetic characters only.

isAlpha(
SALES.PRODUCTS.PROD_CATEGORY
)

The isAlpha() function will test all items in the PROD_CATEGORY column and return true for those that are alphabets only and false otherwise.


Use the following steps for detailed instructions on how to use the isAlpha() boolean function to tackle the above example in an insight :

Note

In the Cluster Management Console (CMC), create a tenant that includes Sample Data. The Sample Data includes the SALES schema.

  • In the Navigation bar, select the Content tab, and then select + New → Add Dashboard.
  • In the Add Dashboard dialog, for Name, enter Product Dashboard, and then select Add.
  • In the Action bar, select + (add icon), or select + Add Insight.
  • In the Insight panel, select Listing Table or V.
  • In Tables, select Aggregated Table.
  • In the Data panel, select Manage Dataset.
  • In the Manage Data Sets panel, in Tables, select SALES. Close the panel.
  • From the Data panel, drag and drop the following columns to the respective tray:
    • Category from the PRODUCTS table to the Grouping Dimension tray.
    • Revenue from the SALES table to the Measure tray.
      • In the Properties panel, for Number Format, select Dollar Rounded.
  • From the Data panel, drag and drop Add Formula to the Grouping Dimension tray.
  • The Formula Builder automatically opens:
    • In Search Functions, select the down arrow, and then select Boolean Functions.
    • Double-click the isAlpha function, isAlpha(value), to add the formula to the editor.
    • In the Formula Editor, replace value with Category from the Data panel.
isAlpha(SALES.PRODUCTS.PROD_CATEGORY)
  • Select Validate & Save.
  • In the Properties panel, for Column Label, enter isAlpha().
  • Name the insight Revenue Per Category.
  • In the Action bar, select Save.