Skip to content

Commit c8fbb1d

Browse files
committed
abc doc
1 parent a8c0031 commit c8fbb1d

1 file changed

Lines changed: 19 additions & 19 deletions

File tree

vignettes/articles/abc.qmd

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
title: "ABC Segmentation"
3-
subtitle: "How to use segmentation strategies to simplify your analysis"
2+
title: "ABC Classification"
3+
subtitle: "How to use classification strategies to focus your analysis"
44

55
---
66

@@ -15,29 +15,24 @@ quarto::write_yaml_metadata_block(
1515
### Introduction
1616

1717
In business and financial analytics, the **ABC classification** method is widely used to categorize items, customers, or other groups according to their relative contribution to a total metric.
18+
The `abc()` function provides an easy way to classify a group's member by their relative contribution of either their **transaction counts** or the sum of a **numeric variable** such as sales margin or revenue.
1819

19-
The `abc()` function provides a flexible and robust way to perform ABC segmentation, either based on **transaction counts** or the sum of a **numeric variable** such as sales margin or revenue.
20-
21-
### Function Purpose
22-
23-
`abc()`:
24-
25-
- Segments a dataset into categories (A, B, C, etc.) based on cumulative contribution.
26-
- Allows for **custom break points** (e.g., top 10% = A, next 40% = B, etc.).
27-
- Works on both **grouped tibbles** and **database-backed objects**.
28-
- Returns a **segment object**, which is processed by `calculate()` to produce a table of results.
20+
- Allows for **custom break points** (e.g., top 10% = A, next 40% = B, etc.)
21+
- Works on both **tibbles** and **database objects**
22+
- Returns a **segment object**, which is processed by `calculate()` to produce a table of results
2923

3024
### How It Works
3125

32-
> `fpaR::abc()` requires a grouped tibble or lazy DBI object using `dplyr::group_by()` to specify the groups that drive the contribution
26+
> `abc()` requires a grouped tibble or lazy DBI object using `dplyr::group_by()` to specify the group composition that drives the contribution
3327
3428
**Value Capture**
3529

36-
- If `.value` is provided, the the column is aggregate per group; otherwise, it counts rows.
30+
- If `.value` is provided, then that column is aggregate per group member; otherwise, it counts rows
3731

3832
**Category Values**
3933

40-
- Provide the break points break points that are used to set the cumulative categories. Each break point will get a letter category starting with 'A'
34+
- Provide the break points that are used to set the cumulative categories
35+
- Each break point will get a letter category starting with 'A'
4136
- If you want to see the stores that make up the top 40% of revenue follow by top 70% and then 90% you should put in `c(0.4,.7,.9,1)`
4237

4338

@@ -74,15 +69,20 @@ contoso::sales |>
7469
)
7570
```
7671

77-
The function returns a **segment object**. Use `calculate()` to generate the ABC classification table:
72+
The function returns a **segment object**
73+
74+
- This will summarize the series of actions and meta information about your data
75+
- Use `calculate()` to generate the ABC classification table
76+
- This will return a duckdb DBI object use `dplyr::collect()` to return a tibble
7877

7978
```{r}
80-
#| label: var
79+
#| label: calculate
8180
#| echo: true
8281
#| eval: false
8382
#| warning: false
8483
#| message: false
8584
#| include: true
85+
8686
contoso::sales |>
8787
dplyr::group_by(store_key) |>
8888
fpaR::abc(
@@ -122,7 +122,7 @@ This table contains grouped data with various metrics, highlighting the contribu
122122

123123
### Understanding the Results
124124

125-
- Store 540 has a margin of $7,812.11 ("ABC Margin"), which accounts for about 4% ("prop_total") of the total margin across all stores
125+
- Store 540 has a margin of $7,812.11 ("ABC Margin"), which accounts for about 4% ("prop_total") of the total margin across all stores
126126

127127
- The "cum_sum" column tracks the running total of values (e.g., revenue or count) for each store, showing the cumulative sum up to that row
128128

@@ -136,7 +136,7 @@ This table contains grouped data with various metrics, highlighting the contribu
136136

137137
- The category_value and category_name columns define the breakpoints you provided, assigning stores to categories (e.g., 'A', 'B', 'C') based on their cumulative contribution
138138

139-
This is summarized in @tbl-output below
139+
This is summarized in @tbl-output below:
140140

141141

142142
```{r}

0 commit comments

Comments
 (0)