---
id: object/codeunit/5833
type: object
title: Codeunit 5833 "Item Statistics"
summary: Codeunit 5833 "Item Statistics" in Base Application (Microsoft.Inventory.Analysis). 11 public procedures. Introduced in BC28, still in BC30.
tier: official
language: en
tags:
  - codeunit
  - base application
versions:
  introduced: "28"
  last_changed: null
  deprecated: null
review:
  state: derived
  by: null
  at: null
  flags: []
generated:
  at: "2026-10-11T00:31:51.816Z"
  pipeline: 0.2.0
  prompts: {}
  input_hash: ddca6873a7161dabe8882674173648e9effc0baadc8c65bb45d38514bf686b08
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/W1/BaseApp/Inventory/Analysis/ItemStatistics.Codeunit.al
    title: src/Layers/W1/BaseApp/Inventory/Analysis/ItemStatistics.Codeunit.al (releases/29.x)
    date: null
    commit: ea08af5ef2d6a9b5c5af4a029288abbe2c883220
    t: null
    quote: null
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
object_type: codeunit
object_id: 5833
name: Item Statistics
namespace: Microsoft.Inventory.Analysis
app: Base Application
extends: null
first_version: "28"
last_version: "30"
present_in:
  - "28"
  - "29"
  - "30"
changed_in: []
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 17
  events: 0
  subscribers: 0
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 0
  calls: 0
  called_by: 1
  implements: 0
---

# Codeunit 5833 "Item Statistics"

> Codeunit 5833 "Item Statistics" in Base Application (Microsoft.Inventory.Analysis). 11 public procedures. Introduced in BC28, still in BC30.

Base Application · Microsoft.Inventory.Analysis · BC28-30 · [source at ea08af5e](https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/W1/BaseApp/Inventory/Analysis/ItemStatistics.Codeunit.al) · facts from BC29

## Properties

| Property | Value |
|---|---|
| Access | Internal |
| Subtype | Normal |

## Procedures

- `CalculateSalesGrowthRate(var Item: Record Item; DateFilterText: Text; PriorPeriodDateFilter: Text): Decimal` (internal): Calculates the sales growth rate for an item over a specified period compared to a prior period.
- `DrilldownSalesGrowthRate(var Item: Record Item; DateFilterText: Text; PriorPeriodDateFilter: Text)` (internal): Drilldown into detailed sales data for the current and prior periods to analyze sales growth.
- `CalculateNetSales(var Item: Record "Item"; DateFilterText: Text): Decimal` (internal): Calculates the net sales for an item over a specified period.
- `CalculateGrossMarginPercentage(var Item: Record "Item"; DateFilterText: Text): Decimal` (internal): Calculates the gross margin percentage for an item over a specified period.
- `CalculateProductReturnRate(var Item: Record "Item"; DateFilterText: Text): Decimal` (internal): Calculates the product return rate for an item over a specified period.
- `DrilldownProductReturnRate(var Item: Record "Item"; DateFilterText: Text)` (internal): Drilldown into detailed item ledger entries to analyze product returns for the specified period.
- `CalculateCurrentInventoryValue(var Item: Record "Item"): Decimal` (internal): Calculates the current inventory value for an item based on its value entries.
- `DrilldownCurrentInventoryValue(var Item: Record "Item")` (internal): Drilldown into detailed value entries to analyze the current inventory value for the item.
- `CalculateExpiredStockValue(var Item: Record Item): Decimal` (internal): Calculates the value of expired stock for an item based on its item to value entries.
- `DrilldownExpiredStockValue(var Item: Record Item)` (internal): Drilldown into detailed item ledger entries to analyze the expired stock value for the item.
- `DrilldownSalesAmount(var Item: Record Item; DateFilterText: Text)` (internal): Drilldown into detailed sales data for an item over a specified period.

Plus 6 local procedures.

## Called by

From the extracted call graph of BC29 (graphify-al on the snapshot checkout): calls whose target is known from a declared type or an `Object::"Name"` argument. Interface dispatch and calls through events are not counted, so the list is not complete.

- [Table 5310 "Item Statistics Cache"](../table/5310.md) (6 calls: `UpdateForItemLedgerEntry → CalculateProductReturnRate`, `UpdateForValueEntry → CalculateCurrentInventoryValue`, `UpdateForValueEntry → CalculateExpiredStockValue`, …)

## Across versions

- Present in: BC28-30
- Changed (declaration) in: none

Source: AL metadata extracted from the code (names, ids, signatures, properties); no code bodies (D10).

## Ask your agent

Procedure bodies are not stored here (D10). The call sections above are our own, per object, from the BC29 call graph. For a procedure body or the calls of one procedure, ask bc-code-atlas (external, by Stefan Maron, MIT; default corpus w1-28), which the bc-observatory plugin connects: `bcatlas_resolve_node(object_type: "codeunit", object_name: "Item Statistics")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
