mark_credited_leads: Identify credited leads

Description Usage Arguments Details

Description

Function checks leads statuses, picking Sent and Credited

Usage

1

Arguments

dt

input data.table

Details

Function logic has following steps - reduce changes to only these, having changed status, "flatten" all other changes, when status is not changed - get lead_id, which were credited, sometimes a couple of days later, after initial send - subset lead_id to these, which have been sent - perform two joins of these datasets - leads_sent and credited - as a result, we have a dataset with the earliest "sent" status, and also a flag credited = y/n (crediting occurs a few days after lead is sent)


piotrgruszecki/fd.dashboard documentation built on March 21, 2021, 6:16 p.m.