Multi values fields include and exclude values

  • How to handle multi value fields in MDX of calculated members
    When handling multi value fields, I would like to find a way to include some values and exclude some other values.
    For example, in ‘Label’ field, I want to count if the values have ‘A’ but have not ‘B’.
    I was using:
    But the result still includes ‘B’ in label when both ‘A’ and ‘B’ are existing in the values.
    Can anyone help? Thanks!

Hi Alex,

You are right, aggregation while excepting some members doesn’t work that well with multiple-value fields. One way to overcome this issue is to create a new dimension based on the existing Label dimension. Create one with the code below:

name = "My Labels"
data_type = "string"
dimension = true
javascript_code = '''
if (issue.fields.labels) {
issue.fields.customfield_labels = issue.fields.labels.sort().join(', ')

The code will create a new dimension that contains a single value for each issue. The value consists of all the issues labels joined together. The calculated measure should work using this dimension.

Kind regards,
Robert / eazyBI support.