All eazyBI for Jira eazyBI for Confluence Private eazyBI

Max

Returns the maximum value of a numeric expression that is evaluated over a set.

Before you create a calculated measure using the MAX function, check whether you can use standard functionality to add statistical calculations.

Syntax

Max(Set_Expression , Numeric_Expression)

Arguments

Set_Expression

MDX expression that returns a set for which to return the Max value.

Numeric_Expression

MDX expression that returns a number by which the Max value will be determined.

On Cloud and since eazyBI version 9.1, the Max() and Min() functions can interpret the dates without converting them to timestamps.

Examples

Max date between the issue due date and the issue resolution date

Returns the later date between the issue due date and the resolution date. This measure can be used if the Issue dimension is used in Rows as the formula compares the issue properties.

TimestampToDate(
  Max(
    --set of members in the Measures dimension
    {[Measures].[Issue due date],
    [Measures].[Issue resolution date]},
    --numeric value for comparison
    DateToTimestamp([Measures].CurrentMember.Value)
  )
)

On Cloud an sice eazyBI version 9.1, you can use the expression without functions that converts a date to a timestamp and other way around:

Max(
  --set of members in the Measures dimension
  {[Measures].[Issue due date],
    [Measures].[Issue resolution date]},
  --numeric value for comparison
  [Measures].CurrentMember.Value
)

Finds the maximum amount of resolved issues in the last 52 weeks

The following example finds the maximum number of resolved issues in the last 52 weeks.

Max(
  {[Time.Weekly].[Week].CurrentDateMember.Lag(52): 
   [Time.Weekly].[Week].CurrentDateMember.PrevMember},
  CoalesceEmpty(
    ([Measures].[Issues resolved], 
    [Time].DefaultMember),
    0
  )
)

Maximum time in days for unresolved issues from the last status change till today

The following example calculates the maximum number of days for unresolved issues from the last status change to today.
The formula pulls in only unresolved issues, and for this set, it looks for those relevant to report selections and calculates the days for those issues from the status update date to now.

Max(
  Filter(
    Descendants([Issue].CurrentMember, [Issue].[Issue]),
    -- for unresolved issues only
    IsEmpty([Measures].[Issue resolution date])
    AND
    -- show on time for issue creation date
    DateInPeriod(
      [Measures].[Issue created date],
      [Time].CurrentHierarchyMember
    )
  ),
  -- calculate days in current status for each relevant issue
  CASE WHEN
    -- check if issue is relevant for the report
    [Measures].[Issues created] > 0
  THEN
    -- calculated days in status
    DateDiffDays([Measures].[Issue status updated date], Now())
  END
)

See also