No simple way to display "share of total"? (4.0)

Hey there,
I am stumped that I cannot find an easy way to allow users to calculate/display a share of total.
I expected there to be either
a) a default “aggregation type” when building the viz (similar to SUM)
b) a way to calculate the share via business calculation

a) does not exist
b) seems to be lacking the functionality (no suitable function / Holistics expression to calculate the overall, ungrouped total) or throws an error when I try to sum a measure like in Looker (nested aggregation)

I do not want to build table models as suggested in the docs because that approach is too static and basically requires to prep all metric & dimension combination in that way.
Creating a custom measure or dimension with sum(field) over () also does not work because of the way the query gets compiled.

Am I missing something here?


Hi @Gabriel,

My apologies for arriving late on this post.
In case the request is still relevant to you: As you have known, Holistics does not support a native feature to calculate Percent of total at the moment.
That said, I definitely agree that this would be a very useful addition. Duly noted for future consideration. I will let you know when there’s an update.

In the meantime, I saw that you already tried to create a custom measure, but the results were not ideal.
Perhaps you’d be interested in using AQL. With it, you can create a one-line measure that is way less clunky and more reusable:

Model line_items {
  measure pct {
    definition: @aql (sum(amount) * 1.0 / (sum(amount) | of_all(line_items));;}

We have put together a tutorial doc for more details: Percent of Total | v4.0 | Holistics Docs.

In case you’re still encountering similar needs, please let me know if this approach works for you. Cheers!

Hi @Gabriel,

Fyi, our AQL (or Analytics Query Language) is currently in Beta. And right now we’re only enabling it on demand for our users.
If you are interesting in trying it out for your use-case above, please see how to enroll in this Release note: [Upcoming] Our brand new Analytics Query Language, AQL!.

I hope this is helpful. Cheers!