Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space DEV and version r0822

D toc

Excerpt

D s product
rtrue
 provides multiple mechanisms for reviewing your column values and identifying patterns in the data format or similar values which mean the same thing. Through simple visual tools, you can select the patterns or clustered value to standardize and, when prompted, the patterns or values to use as their standard. As needed, you can apply formatting or structuring functions to the data for finer grain controls. This section summarizes the available methods of standardization, as well as their recommended uses.

Standardization Methods

You can use any of the following methods for standardizing values in your dataset's columns. Depending on the situation, you may choose to mix-and-match these methods. Details on these methods are below.

MethodDescriptionRecommended UsesHow to Use
By clustering

D s product
can identify similar values using one of the available algorithms for comparing values. You can compare values based on spelling or language-independent pronunciation.

  • Standardize values to correct spelling differences, capitalization, whitespace, and other errors.
  • Values must be consistent across rows of the column.
  • Primarily used for string-based data types.

Available through the Standardize Page

By pattern

D s product
can identify common patterns in a set of values and suggest transformations to standardize the values to a common format.

  • Standardize values to follow a consistent format, such as phone numbers or social security numbers.
  • Data type follows a somewhat consistent format and needs reshaping.
Available in the Patterns tab in Column Details Panel
By functionYou can apply one or more specific functions to cleanse your data of minor errors in formatting or structure.
  • Good method for improving the performance of pattern- or algorithm-based matching.
  • Some functions are specific to a data type, while others have more general application.
Edit column with formula in the Transform Builder.
Mix-and-matchYou can use combinations of the above methods for more complex use cases.
  • Combine function-based standardization for global changes to all values with cluster- or pattern-based standardization for individual value changes.
 

Invalid Values

These standardization techniques assume that your column contains only valid or empty values. 

Tip

Tip: Standardization may help to cut down the number of invalid values. Before you begin standardizing, however, you should select the red bar in the column histogram to review the values that are invalid for the current type and to fix them via suggestion if possible. For more information, see Find Bad Data.

Standardize Values by Clustering

Using one of the supported matching algorithms, 

D s product
 can cluster together similar column values. You can review the clusters of values to determine if they should be mapped to the same value. If so, you can apply the mapping of these values within the application.

For more information, see Overview of Cluster Clean.

Standardize Formatting by Patterns

For individual columns, 

D s product
 can analyze column values for patterns and then provide suggestions for how to normalize the patterned values into a consistent format. For example, the same US phone number can be represented in any of the following methods:

Code Block
555-1212
415-555-1212
4155551212
(415) 555-1212
+1 (415) 555-1212
Tip

Tip: Pattern-based standardization is useful for confirming values in a column to a specific format. This method is applicable to data types like phone numbers, dates, social security numbers, and to a lesser extend email addresses and URLs.

You can apply pattern-based standardization through the Patterns tab. See Column Details Panel.

Standardize Using Functions

The following functions can be useful for standardizing values. 

Functions for strings

All values can be converted to string, so these string functions can be applied to any column if its data type is converted to String data type. 

Tip

Tip: The clustering algorithms may apply some of these functions to values in your column for purposes of comparison.

CategoryFunctionDescription
String ConversionCHAR Function

D excerpt include
pageCHAR Function
nopaneltrue

 UNICODE Function

D excerpt include
pageUNICODE Function
nopaneltrue
 

Case ConversionUPPER Function

D excerpt include
pageUPPER Function
nopaneltrue
 

 LOWER Function

D excerpt include
pageLOWER Function
nopaneltrue
 

 PROPER Function

D excerpt include
pagePROPER Function
nopaneltrue
 

Cleanse FunctionsTRIM Function

D excerpt include
pageTRIM Function
nopaneltrue
 


TRIMQUOTES Function

D excerpt include
pageTRIMQUOTES Function
nopaneltrue

 REMOVEWHITESPACE Function

D excerpt include
pageREMOVEWHITESPACE Function
nopaneltrue
 

 REMOVESYMBOLS Function

D excerpt include
pageREMOVESYMBOLS Function
nopaneltrue
 

String Sizing FunctionsLEFT Function 

D excerpt include
pageLEFT Function
nopaneltrue
 

 RIGHT Function

D excerpt include
pageRIGHT Function
nopaneltrue
 

 PAD Function 

D excerpt include
pagePAD Function
nopaneltrue
 

 String Comparison Functions See Compare Strings

Example:

D s product
 supports nesting functions within each other. The following transformation performs some basic cleanup on all columns in your dataset that are of String cleanup. 

D trans
Typestep
p01NameColumns
p01Value*
p02NameFormula
p02ValueIFVALID($col,'String',LEFT(UPPER(TRIM($col)),32))
SearchTermEdit column with formula

  • The Columns value is a wildcard, which in this case applies the transformation across all columns in the dataset (*).
  • In the Formula, you see a nested expression. If the value in the column is valid against String data type, then, do the following to the column value:

    Info

    NOTE: The IFVALID function tests each row value for validation against the specified data type. It does not test the column against the data type. See IFVALID Function.

     

    • The TRIM function removes leading and trailing whitespace, which may register as a difference between values. See TRIM Function.
    • The UPPER function then converts the output of the TRIM function to all uppercase. So, differences in capitalization are eliminated. See UPPER Function.
    • The LEFT function truncates the output of the UPPER function to a maximum of 32 characters. See LEFT Function.

The net result of this single step applied to all columns is to eliminate whitespace, convert to uppercase, and then truncate the length of each string to only 32 characters.

For more information, see Cleanse Tasks.

Functions for numbers

You can use the following functions to standardize numeric values. 

FunctionDescription
ABS Function

D excerpt include
pageABS Function
nopaneltrue

ROUND Function

D excerpt include
pageROUND Function
nopaneltrue

TRUNC Function

D excerpt include
pageTRUNC Function
nopaneltrue

NUMFORMAT Function

D excerpt include
pageNUMFORMAT Function
nopaneltrue

Example:

For the NUMFORMAT function, you can specify the full format to which you want the numeric values in the column to confirm. In the following example, all values that contain a decimal point and match with the Decimal (Float) type are forced to add a value before the decimal. This step converts values like .00 to 0.00, which standardizes the format of your numbers.

D trans
Typestep
p01NameColumns
p01Value*
p02NameFormula
p02ValueIF(FIND($col, '.')>0, IFVALID($col, 'Float',NUMFORMAT(ROUND($col,2), '0.00')),$col)
SearchTermEdit column with formula

  • The Columns value is a wildcard, which in this case applies the transformation across all columns in the dataset (*).
  • In the Formula, you see a nested expression, which is a bit more complicated than the preceding String example. 
    • The outer IF function tests if the FIND function returns a non-zero value when searching each column value for the period (.). Values that match could possibly be decimals and require further evaluation:
    • If the value in the column is valid against the Decimal (Float) data type then do the following:

      • ROUND the value to two decimal points. For more information, see ROUND Function.

      • Format the value in the following manner:

        Code Block
        0.00
      • The above format includes the two decimal points to which you rounded, adding any extra zeros if they are not present in the input rounded value.
      • Additionally, another zero is inserted in front of the decimal if it is missing in the output of the ROUND function.
      • For more information on number formats, see NUMFORMAT Function.

For more information, see Normalize Numeric Values.

Functions for dates

Since dates are structured patterns of string-based data, the best approach is to begin by using the Patterns tab in the Column Details panel. See below. 

For more detailed modifications, you can specify formatting strings that are applied as part of the DATEFORMAT function to the dates in your column.

FunctionDescription
DATEFORMAT Function

D excerpt include
pageDATEFORMAT Function
nopaneltrue


For more information including examples on the DATEFORMAT function, see Format Dates.

Custom Data Types

You can create custom datatypes to use as a form of standardization. Values in a column that do not conform to the custom type are flagged as invalid and can be triaged accordingly.

Info

NOTE: A custom data type does not inherently provide a means of standardizing the values. The values flagged as invalid must be converted to valid values or removed.

Custom type using a dictionary file

You can upload a dictionary file containing the list of accepted values for the custom type.

Info

NOTE: This method is likely to be superseded by dictionaries that can be applied through the Standardize page.

For more information, see Create Custom Data Types.

Custom type using a regular expression

A custom data type can be created based on a user-defined regular expression.

Info

NOTE: Regular expressions are powerful tools for creating matching patterns. They are considered developer tools.

For more information, see Create Custom Data Types Using RegEx.