import { Dimension, DisplayBehaviour, IMember, ISlicer, Measure, PrimitiveType, PropertyName } from '../types'; import { EntityProperty } from './property'; import { ParameterProperty, Property } from './sdl'; export declare enum AggregationOperation { SUM = "SUM", COUNT = "COUNT", MIN = "MIN", MAX = "MAX", AVERAGE = "AVERAGE", STDEV = "STDEV", STDEVP = "STDEVP", MEDIAN = "MEDIAN", TOP_PERCENT = "TOP_PERCENT", TOP_COUNT = "TOP_COUNT", TOP_SUM = "TOP_SUM" } export declare const AggregationOperations: { value: AggregationOperation; label: string; }[]; export declare const AggregationCompareOperations: { value: string; label: string; }[]; /** * Calculated property types */ export declare enum CalculationType { /** * Restricted Measure */ Restricted = "Restricted", /** * Formula Measure */ Calculated = "Calculated", /** * Conditional Aggregation */ Aggregation = "Aggregation", Variance = "Variance", D2Measure = "D2Measure", MeasureControl = "MeasureControl", /** * Indicator generation */ Indicator = "Indicator", /** * Parameter */ Parameter = "Parameter" } export interface CalculatedMember { __id__?: string; name: string; label?: string; formula: string; aggregator?: string; dimension?: string; hierarchy?: string; visible?: boolean; caption?: string; description?: string; properties?: Array<{ name: string; value: string; }>; formatting?: { unit?: string; decimal?: number; }; } export interface NamedSet { name: string; caption?: string; description?: string; formula?: string; Formula?: string[]; } /** * Calculation measures or member sets */ export interface CalculationProperty extends EntityProperty { calculationType: CalculationType; aggregator?: string; } export interface CalculatedProperty extends CalculationProperty, CalculatedMember { } /** * Restricted measure property ( a sub type calculation property ) */ export interface RestrictedMeasureProperty extends CalculationProperty { /** * The measure name */ measure: PropertyName; /** * Free dimensions for the indicator */ dimensions?: Array; /** * The slicers to restrict measure */ slicers?: ISlicer[]; /** * Enable Constant Selection */ enableConstantSelection?: boolean; /** * All Selection Context Dimensions */ allSelectionContext?: boolean; /** * Constant Dimensions */ constantDimensions?: Array; formatting?: { unit?: string; decimal?: number; }; } /** * Conditional aggregation property */ export interface AggregationProperty extends CalculationProperty { /** * The aggregate operation */ operation: AggregationOperation; /** * The measure name for aggregation */ measure?: PropertyName; /** * for TopPercent TopCount */ value?: number | string; /** * Filter members by compare aggregated measure to value: * ```sql * Filter( * [Region].[Province].Members, * [Measures].[Sales Amount] > 1000000 * ) *``` */ compare?: '>' | '<' | '=' | '<=' | '>=' | '!=' | 'empty' | 'not_empty'; /** * Aggregation dimensions of the calculation measure */ aggregationDimensions: Array; /** * Is using conditional dimension slicers */ useConditionalAggregation?: boolean; /** * Conditional slicers applied to aggregation */ conditionalDimensions?: Array; /** * Using exclusion operations with conditionalDimensions slicers */ excludeConditions?: boolean; } export declare enum CompareToEnum { CurrentMember = "CurrentMember", SelectedMember = "SelectedMember", Lag = "Lag", Lead = "Lead", Parallel = "Parallel", Ancestor = "Ancestor" } export interface CompareToType { type: CompareToEnum; value?: number | string; slicer?: ISlicer; } /** * Calculates the difference between a member and another specified member */ export interface VarianceMeasureProperty extends CalculationProperty { /** * The measure to compare */ measure: Measure; baseDimension: Dimension; compareA: CompareToType; toB: CompareToType; /** * Set No data as Zero */ asZero?: boolean; /** * Whether it is a ratio */ asPercentage?: boolean; /** * Directly divide A / B */ directDivide?: boolean; /** * Take the absolute value of the denominator * `(A - B) / abs(B)` */ absBaseValue?: boolean; /** * A: `(A - B) / A` * B: `(A - B) / B` */ divideBy?: 'A' | 'B'; } /** * @deprecated use CubeParameterEnum */ export declare enum ParameterControlEnum { Input = 0, Select = 1, Dimensions = 2 } export declare enum CubeParameterEnum { Input = "input", Select = "select", Dimension = "dimension" } export interface MeasureControlProperty extends CalculationProperty { value: PrimitiveType; allMeasures: boolean; availableMembers: Array; displayBehaviour?: DisplayBehaviour; } export declare const isCalculationProperty: (toBe: any) => toBe is CalculationProperty; export declare const isCalculatedProperty: (toBe: any) => toBe is CalculatedProperty; export declare const isAggregationProperty: (toBe: any) => toBe is AggregationProperty; export declare const isRestrictedMeasureProperty: (toBe: any) => toBe is RestrictedMeasureProperty; export declare const isVarianceMeasureProperty: (toBe: any) => toBe is VarianceMeasureProperty; export declare const isMeasureControlProperty: (toBe: any) => toBe is MeasureControlProperty; export declare const isIndicatorMeasureProperty: (toBe: any) => toBe is RestrictedMeasureProperty; export declare const isParameterProperty: (toBe: any) => toBe is ParameterProperty; export declare const isCalendarProperty: (toBe: any) => boolean; export declare function getMeasurePropertyUnit(property: Property): string; export declare function parameterFormatter(name: string): string; export declare function indicatorFormatter(name: string): string; export declare const isCalculatedMember: (toBe: any) => toBe is CalculatedMember; export declare function formatCalculatedMemberName(member: CalculatedMember): string;