All eazyBI for Jira eazyBI for Confluence Private eazyBI

Replace

Replaces one substring with another in the defined string. In the given String_Expression1, the function finds a fragment String_Expression2 and replaces it with a new value String_Expression3.

Syntax

 Replace(String_Expression1, String_Expression2, String_Expression3 )

Arguments

String_Expression1

MDX expression returning an original string that should be parsed and modified.

String_Expression2

A substring to look up in the original string value.

String_Expression3

A new string to use instead of the substring.

Examples

Example1

The following example would replace the key (with CAST operator converted as string) from the Issue dimension member with an empty string. As a result, it should return the Issue dimension summary (without issue key)

Replace(
	[Issue].CurrentHierarchyMember.Name, 
	Cast([Issue].CurrentHierarchyMember.Key as String), 
	""
)

Example2

The following example would replace the comma (,) with a different separator (|) when searching members from the Approvals dimension and filtering those where a current user name can be found in the members for the Approval member name. 

Aggregate(
  Filter(
    [Approvals].[Approvals].Members,
    CurrentUserName() MATCHES 
      Replace([Approvals].CurrentMember.GetCaption,",","|")
  )
)

The following code would return a user-friendly name for the "Approvals" dimension member which usually is a comma-separated string of users since this dimension is imported from a multi-user picker custom field.

[Approvals].CurrentMember.GetCaption

See also

  • Function CurrentUserName to return the name for the current user who logged into eazyBI and loads the report.
  • Function GetCaption to return the user-friendly name of the member.