getRfmTable: Get RFM values and scores

getRfmTableR Documentation

Get RFM values and scores

Description

Get RFM values and scores

Usage

getRfmTable(customerData, transactionData, id, tData_visitDate,
  tData_revenue, cData_visitDate = NULL, recencyFloorDate = NULL,
  reportDate = NULL, bins = 5)

Arguments

customerData

tibble, customer unique records, must contain primary key.

transactionData

tibble, transaction records, must contain foreign key.

id

key name, should be found in both customerData and transactionData.

tData_visitDate

field name of visit date column in transactionData. This field must be in the class of POSIXct. Any records containing NA will be removed.

tData_revenue

field name of revenue column in transactionData, any records containing NA will be removed.

cData_visitDate

field name of last visit date in customerData. This field must be in the class of POSIXct; optional, default value is NULL. If using default value, recencyFloorDate will be applied to fill tData_visitDate for the cases of "did not come back" (customers were only found in customerData, but could not be found in transactionData). If not using default value, the specified field will be applied to fill tData_visitDate for the cases of "did not come back". If the specified field contains missing values, highly recommend to use recencyFloorDate instead.

recencyFloorDate

recency floor date for "did not come back" customers; optional, default value is the oldest date of tData_visitDate, must be in the class of POSIXct.

reportDate

recency ceiling date; optional, default value is the newest date of tData_visitDate, must be in the class of POSIXct.

bins

bins for RFM scores; optional, default value is 5.

Value

A tibble containing RFM values, percentile rank, scores and z-score.


maxleungtszchun/customerAnalytics documentation built on July 27, 2023, 9:24 a.m.