Skip to contents

Create a summary of the event-log.

Usage

elog_summary(elog, currency = "$", fiscal_year_start = 1)

Arguments

elog

Event log, a data.frame with field cust for the customer ID and field date for the date/time of the event, which should be of type Date or POSIXt. If sales or returns field is present, it will be aggregated. See details for more information.

currency

Currency to paste in front of sales. Can take from config$CURRENCY.

fiscal_year_start

Fiscal year starting month as numeric. Default is January (1).

Examples


elog_summary(elog_validated$elog)
#> 

#> 
#> Building packages ■■■■■■■■■■■■■                     42% | ETA:  2m

#> 

#> ── Elog Summary ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
#> Building packages ■■■■■■■■■■■■■                     42% | ETA:  2m

#> 

#> • 9,812 customers
#> Building packages ■■■■■■■■■■■■■                     42% | ETA:  2m

#> 

#> • 18,136 transactions
#> Building packages ■■■■■■■■■■■■■                     42% | ETA:  2m

#> 

#> • 1.8 average transactions per customer
#> Building packages ■■■■■■■■■■■■■                     42% | ETA:  2m

#> 

#> • 44,029 items purchased
#> Building packages ■■■■■■■■■■■■■                     42% | ETA:  2m

#> 

#> • $2,346,701 sales
#> Building packages ■■■■■■■■■■■■■                     42% | ETA:  2m

#> 

#> • 2.4 average items per transaction
#> Building packages ■■■■■■■■■■■■■                     42% | ETA:  2m

#> 

#> • $129 average value per item
#> Building packages ■■■■■■■■■■■■■                     42% | ETA:  2m

#> $n_cust
#> [1] 9812
#> 
#> $overall_summary
#> # A tibble: 1 × 7
#>   new_customers    sales transactions items_purchased avg_transactions
#>           <int>    <dbl>        <int>           <int>            <dbl>
#> 1          9812 2346701.        18136           44029             1.85
#> # ℹ 2 more variables: items_per_transaction <dbl>, aov <dbl>
#> 
#> $summary_by_year
#> # A tibble: 5 × 8
#>   first_year new_customers   sales transactions avg_transactions items_purchased
#>        <int>         <int>   <dbl>        <int>            <dbl>           <int>
#> 1       2017          1278 417377.         2932             2.29            7108
#> 2       2018          1484 479164.         3173             2.14            8008
#> 3       2019          2232 632095.         4579             2.05           11561
#> 4       2020          3343 623713.         5581             1.67           13080
#> 5       2021          1475 194352.         1871             1.27            4272
#> # ℹ 2 more variables: items_per_transaction <dbl>, aov <dbl>
#>