Skip to content

Latest commit

 

History

History
55 lines (40 loc) · 2.71 KB

report-builder-functions-level-function.md

File metadata and controls

55 lines (40 loc) · 2.71 KB
title description author ms.author ms.date ms.service ms.subservice ms.topic ms.custom
Level function in a paginated report
Discover the Level function in Report Builder. This function returns the current level of depth in a recursive hierarchy in a paginated report.
kfollis
kfollis
09/25/2024
reporting-services
report-design
how-to
updatefrequency5

Report Builder functions - Level function in a paginated report (Report Builder)

[!INCLUDEssrs-appliesto] [!INCLUDE ssrs-appliesto-ssrs-rb] [!INCLUDE ssrs-appliesto-pbi-rb] [!INCLUDE ssrb-applies-to-ssdt-yes]

Returns the current level of depth in a recursive hierarchy in a paginated report.

Note

[!INCLUDEssRBRDDup]

Syntax

  
Level(scope)  

Parameters

scope
(String) (Optional). The name of a dataset, group, or data region that contains the report items to which to apply the aggregate function. If scope is not specified, the current scope is used.

Return Type

Returns an Integer. If scope specifies a dataset or data region, or specifies a nonrecursive grouping (that is, a grouping with no Parent element), Level returns 0. If scope is omitted, it returns the level of the current scope.

Remarks

The value returned by the Level function is zero based; that is, the first level in a hierarchy is 0.

The Level function can be used to provide indentation in a recursive hierarchy, such as an employee list.

For more information about recursive hierarchies, see Creating Recursive Hierarchy Groups (Report Builder and SSRS).

Example

The following code example provides the level of row in the Employees group:

=Level("Employees")  

Related content