Counting number of multiple entries in a field

I found this formula to calculate the number of multiple entries in a Jira field:
CASE WHEN
Not IsEmpty(
[Measures].[Issue Parent Account Name]
)
THEN
Val(Len([Measures].[Issue Parent Account Name]) - Len(Replace([Measures].[Issue Parent Account Name], ‘,’, ‘’))+1)
ELSE
0
END

However, if an Account Name has a comma in its name, i.e., eazyBI, Inc, it counts as two entries. Is there a way to exclude counting entries with commas before Inc., INC, or other custom text, such as (none)?

1 Like

Hi @eazyBI2

Please try the below formula and see if it returns the expected results? I used Generate function to change the value seperators to symbol “;”, this way avoiding the part where “,” are being counted.

Val(Len(
  Generate(
    Filter([Parent Account Name].[Parent Account Name].Members,
    [Parent Account Name].CurrentMember.Name <> "(none)" AND
    [Measures].[Issues created]>0
    ),
  [Parent Account Name].CurrentMember.name, ";"
)
)
- 
Len(
Replace(
   Generate(
    Filter([Parent Account Name].[Parent Account Name].Members,
    [Parent Account Name].CurrentMember.Name <> "(none)" AND
    [Measures].[Issues created]>0),
  [Parent Account Name].CurrentMember.name, ";"
)
, ";",""
)
)+1)

Best wishes,

Elita from support@eazybi.com

thanks for this! It seems to be on the right track, but unfortunately it does not return the expected results. It returns the value ‘1’ for every issue, even when there are multiple entries in the field. It seems the comma is being excluded from both the name of an entry and the entry separator value “,”.

could it be tweaked to not exclude the separator comma?