Skip to contents

Match memberships to contributions based on matching create_dt, init_dt/cont_dt, and alignment between memb_amt + AVC_amt, recog_amt, start_amt and the cont_amt of the contribution. Expected to fix 90% of unmatched contributions.

Usage

contribution_membership_match(contributions, memberships)

set_contribution_membership_match(contributions, memberships)

Arguments

contributions

data.table of contributions, must include columns group_customer_no, ref_no, cust_memb_no, campaign_category_desc, cont_amt, create_dt, cont_dt

memberships

data.table of memberships, must include columns group_customer_no, cust_memb_no, campaign_category_desc, memb_amt, AVC_amt, recog_amt, start_amt, create_dt, init_dt

Value

data.table of contributions with cust_memb_no updated to match the appropriate membership in memberships

Functions

  • set_contribution_membership_match(): updates contributions$cust_memb_no for up to one contribution per membership, intended to be called iteratively from within contribution_membership_match