Trying to aggregate data using Affected Version so I can report all minor and major versions as one version release.
For example:
release 1.0 + release 1.1 + release 1.1.1 = Release 1
Release 2.0 + release 2.1 + release 2.2 = Release 2
Seen examples for Fix Version but they don’t work using Affected Version
You can Aggregate(…) the Fix version dimension members in the Fix version dimension based on the naming pattern.
Another way, if you only need to sum one or some measures, you can create new calculated measures that dynamically find the first part of the Fix Version name and attach all other minor versions to it. Here is an example for the pattern you used in the example:
CASE WHEN [Fix Version].CurrentHierarchyMember.Name MATCHES ".*\.0" THEN -- when version name ends with .0
Sum(Filter(
[Fix Version.By status].[Version].Members, -- go through all versions in Status hierarchy
[Fix Version.By status].CurrentMember.get("PARENT_KEY") -- find the versions from the same project (parent names match
MATCHES [Fix Version].CurrentMember.get("PARENT_KEY")
AND
[Fix Version.By status].CurrentMember.Name -- and the version name matches extension of current name
MATCHES ExtractString([Fix Version].CurrentMember.Name, "(.*)\..*", 1) || ".*"
),
([Measures].[Issues created], [Fix Version].DefaultMember) -- here we sum issues created. This can be replaced with any other measure
)
END
Thanks Lauma. I was looking for a solution for Affected Version not Fix Version. I’m getting a null pointer exception when I change fix version to affected version.
Sorry for not noticing you were looking for Affects Version!
By replacing the Fix Version with Affects Version, you are very much on the right track. Unfortunately, Affects Version does not have a property PARENT_KEY to check that the version is from the same project, and this is where the formula fails.
Still, we can use Parent names for this check. Please try the following formula:
CASE WHEN [Affects Version].CurrentHierarchyMember.Name MATCHES ".*\.0" THEN
Sum(Filter(
[Affects Version.By status].[Version].Members,
[Affects Version.By status].CurrentMember.Parent.Name
MATCHES [Affects Version].CurrentMember.Parent.Parent.Name
AND
[Affects Version.By status].CurrentMember.Name
MATCHES ExtractString([Affects Version].CurrentMember.Name, "(.*)\..*", 1) || ".*"
),
([Measures].[Issues created], [Affects Version].DefaultMember)
)
END
Can you please give a screenshot of which versions you would like to sum? How are they grouped in the Fix Version dimension now?
Do you mean that no matter what is the prefix string, 1.0 and 1.1 Story points resolved should be summed together?
@lauma.cirule That is exactly what I mean, that no matter what is the prefix string, 1.0 and 1.1 story points resolved should be summed. Here’s an example of the Fix Version names I am trying to sum: “PPAP2 FBM 1.0”, “P1 Build - FBM 1.1”, “P2 Build FBM 1.2”, “C3 Durability Failure 1.6”
Quite simply, I want to be able to add more context to the Version name than just “1.0”, “1.1”, “1.2”, etc.
I see that the pattern is that the number of versions is at the end of the name. In such a case, we can construct the regex in a way that we add any symbol (.*) at the beginning of the matching string and then find the number before .; then add that there is any number behind the dot :