I am attempting to make a table that shows the distinct count of resources in one column, and the associated percentages of the whole in another column.
Within my data resources can be spread across multiple groups hence why I am using distinct count.
The calculated field to get the distinct count of resources is distinct_Count(Resource_ID).
When I try to create the % calculated field, I get an error saying that “Adding totals to distinct count aggregations is currently unsupported.”. The calculation for this field is percentOfTotal(distinct_Count(Resource_ID)).
Is there a workaround to get this calculation working? I understand that since resources are in multiple groups, the total percentages will add up to over 100% which is ok for now.
I do you have any other unique attributes for the resource id like another UUID or timestamp? Then you could try something like countOver instead and partition by the unique attribute.
The other way would be doing this in SQL if you are able to do that on your dataset.
When using countOver in the formula below I am getting the expected result. X-Axis Grouping is a calculated field that is determined from a parameter selection by the user.
countOver({Resource_ID}, [{X-Axis Grouping}])
However when I attempt to use that calculation with the percentOfTotal, I am getting the following error: “We encountered an error trying to save your calculated field. Please try creating it again.”
Instead of using percentofTotal could you try the following calculated field: distinctCountOver({resourceID}, [{X-Axis Grouping}], PRE_AGG)/distinctCountOver({resourceID}, [], PRE_AGG)