Kyvos Custom Functions
This documentation is for Kyvos 2026.6.x. To view documentation for other Kyvos versions, click here. |
|---|
Identify_Member
Description: Kyvos-specific function. Identifies and returns a member based on custom search criteria string. Used when members need to be located programmatically using attribute-based patterns.
Syntax: Identify_Member(Criteria_String)
Input: A string expression defining search criteria
Output: The identified member
Business Use Case: Dynamically locate a product category member by attribute value.
WITH MEMBER [Measures].[Identified Sales] AS (Identify_Member("Category=Bikes"),
[Measures].[Internet Sales Amount]) SELECT
[Measures].[Identified Sales] ON COLUMNS FROM [Adventure Works]BITSETINTERSECTION
Description: Kyvos-specific high-performance function. Performs an intersection of two sets using
optimized bitset operations. Significantly faster than standard intersect on large member sets.
Syntax: BITSETINTERSECTION(Set_Expression1, Set_Expression2)
Input: Two set expressions
Output: The intersection set (members in both sets)
Business Use Case: Efficiently find which products are in both the Bikes descendants and the top-100 sellers — critical for large catalogs where standard Intersect would be slow.
SELECT
[Measures].[Internet Sales Amount] ON COLUMNS, BITSETINTERSECTION(
[Product].[Product].[Product].Members, Descendants(
[Product].[Product Categories].[Category].[Bikes], [Product].[Product Categories].[Product])) ON ROWS
FROM [Adventure Works]Performance Note: Use instead of when both sets contain thousands of members. The bitset algorithm runs in O(n) vs O(n²) for naive intersection.
AllValue
Description: Returns the measure value at the "All" level of a dimension — the unconstrained grand total, regardless of current query or slicer context.
Syntax: AllValue(Measure_Expression, Dimension_Expression)
Input: A measure reference and a dimension
Output: The total value of that measure across all members of that dimension
Business Use Case: Calculate each product's percentage contribution to the overall total inline.
WITH MEMBER [Measures].[% of Total Sales] AS DIVIDE(
[Measures].[Internet Sales Amount], AllValue([Measures].[Internet Sales Amount],
[Product].[Product Categories]),
0),
FORMAT_STRING = "Percent" SELECT
{[Measures].[Internet Sales Amount], [Measures].[% of Total Sales]} ON COLUMNS,
[Product].[Product Categories].[Category].Members ON ROWS
FROM [Adventure Works]
[Product].[Product Categories].[Category].Members ON ROWS
FROM [Adventure Works]ResponseSubset
Description: Kyvos custom function. Returns a filtered subset of a response/result set based on a condition
— used to apply secondary filtering on computed result sets.
Syntax: ResponseSubset(Set_Expression, Condition_Expression)
Input: A set expression and a filter condition
Output: Members satisfying the condition
WITH MEMBER [Measures].[High Margin Sales] AS SUM(
ResponseSubset(
[Product].[Product Categories].[Product].Members, ([Measures].[Internet Sales Amount] - [Measures].[Total Product Cost])
/ [Measures].[Internet Sales Amount] > 0.30), [Measures].[Internet Sales Amount])
SELECT
[Measures].[High Margin Sales] ON COLUMNS FROM [Adventure Works]