Learn R Programming

conjurer (version 1.7.1)

buildCust: Build a Unique Customer Identifier

Description

Builds a customer identifier. This is often used as a primary key of the customer dim table in databases.

Usage

buildCust(numOfCust)

Value

A character with unique customer identifiers

Arguments

numOfCust

A natural number. This specifies the number of unique customer identifiers to be built.

Details

A customer is identified by a unique customer identifier(ID). A customer ID is alphanumeric with prefix "cust" followed by a numeric. This numeric ranges from 1 and extend to the number of customers provided as the argument within the function. For example, if there are 100 customers, then the customer ID will range from cust001 to cust100. This ensures that the customer ID is always of the same length.

Examples

Run this code
df <- buildCust(numOfCust = 1000)
df <- buildCust(numOfCust = 223)

Run the code above in your browser using DataLab