Skip to contents

A Business Intelligence Toolkit for Financial Planning & Analysis (FP&A)

fpaR is a collection of business intelligence tools designed to simplify common financial planning and analysis (FP&A) tasks such as time intelligence calculations, customer, vendor or product segmentation, and factor/variance analysis

The package is inspired by best practices from a collection of blogs, books, industry research, and hands-on work experience, consolidating frequently performed business analyses into a fast, efficient, and reusable framework

In particular, the time intelligence functions are heavily inspired by PowerBI DAX functions

Under the hood, these functions are built upon the great foundations of:

fpaR is designed to seamlessly work with either tibbles or modern databases (DuckDB, Snowflake, SQLite, etc) with a unified syntax

Even if you are working with tibbles, most functions are optimized to leverage DuckDB for superior speed and performance.1

By default most fpaR function returns a lazy DBI object which you can return as a tibble with dplyr::collect()

Key features & benefits

  • Unified syntax regardless if your data is in a tibble or a database
  • Scale your data with duckdb to optimize your calculations
  • Instant clarity as every function summarizes its transformation actions so that you can understand and validate the results

Installation

Install the development version of fpaR from GitHub:

# Install using pak or install.package()

pak::pak("usrbinr/fpaR")

What is in fpaR?

There are 3 main categories of functions:

  • Time intelligence
  • Segmentation strategies
  • Factor analysis (work in progress)

Datasets

We recommend using the Contoso package for any practice analysis. The contoso datasets are fictional business transaction of Contoso toy company which are helpful for business intelligence related analysis

Time intelligence

fpaR provides readily available functions for most time intelligence analysis such as Year-over-Year(yoy()), Month-to-Date(mtd()), and Current Year-to-Date over Previous Year-to-Date (ytdopy()) analysis

These functions are designed to quickly answer most common time intelligence related analysis in a consistent, fast and transparent way

Key benefits:

  • Auto-fill missing dates: Ensures no missing periods in your datasets so that right period comparisons are performed

  • Flexible calendar options: Handle comparisons based on a standard or 5-5-4 fiscal calendar to accommodate different reporting frameworks

  • Period imbalance indicator: When comparing periods with dates imbalance, the time intelligence functions will alert you to the type and number of period imbalances to ensure you are aware of misleading likewise comparisons

Below is the full list of time intelligence functions:

Function Description Shift Aggregate Compare
YoY Full Year over Year X
YTD Year-to-Date X
PYTD Prior Year-to-Date amount X X
YoYTD Current Year-to-Date over Prior Year-to-Date X X X
YTDOPY Year-to-Date over Full Previous Year X X X
QoQ Full Quarter over Quarter X
QTD Quarter-to-Date X
PQTD Prior Quarter-to-Date X X
QOQTD Quarter-over-Quarter-to-Date X X X
QTDOPQ Quarter-to-Date over Full Previous Quarter X X X
MTD Month-to-Date X
MoM Full Month over Full Month X
MoMTD Current Month-to-Date over Prior Month-to-Date X X X
PMTD Prior Month’s MTD amount X X
MTDOPM Month-to-Date over Full Previous Month X X X
WTD Week-to-Date X
WoW Full Week over Full Week X
WoWTD Current Week-to-Date over Prior Week-to-Date X X X
PWTD Prior Week-to-Date X X
ATD cumlaitve total from inception to date x
DoD Full Day over Full Day X

Segmentation Strategies

ABC Classification

ABC classification is an business analysis technique that categorizes items (like products, customers, or suppliers) based on their relative contribution of a value. It facilities the Pareto Principle (the 80/20 rule), suggesting that a small percentage of items contribute to the largest percentage of the total value

The analysis will assign a letter category to each break point so that you can further focus your analysis

Cohort

Cohort analysis is a type of behavioral analytics that takes data from a given group of users (a cohort) and tracks their activity over time. A cohort is typically defined by a shared starting characteristic, most commonly the time period in which the entities first interacted with the product or service

This allows you to understand retention, turnover and other attributes more clearly

Function Description Categorizes Time-Based Tracks Over Time
abc() ABC Classification groups items by relative contribution (Pareto analysis). X
cohort() Cohort analysis groups entities by a shared start point and analyzes behavior over time. X X

Factor / Variation Analysis

Breaks down revenue or cost changes into price, volume, and mix effects.


Future capabilities

Is there a future capability that you want to see here? please open up a discussion on our github site

Additional references and inspirations