Percent of total line chart

Is there an easy way to graph percent of total on a line chart rather than the individual values?

It seems like it shouldn't be too difficult but I don't see an option.

Comments

  • That simply changes the label. It does not appear to have an impact on the values in the chart. As you can see in the image, the scale on the left is not percent of total.


  • You need to make sure the "window functions in beast modes" is enabled in your instance. Your CSM can get it enabled for you if it is not. You can then do something like this, changing the name of the field to yours:


    sum(amount) / sum(sum(amount)) 
    

     

     You can watch this video for a good walkthrough about it.

    https://www.youtube.com/watch?v=eifSYZIcPzg&t=868s

    **Check out my Domo Tips & Tricks Videos

    **Make sure to <3 any users posts that helped you.
    **Please mark as accepted the ones who solved your issue.
  • @MarkSnodgrass if I am graphing count(id) over time, how would I change your formula?

  • Dealing with counts is a little different. Try this:

    SUM(SUM(1)) OVER (PARTITION BY `id`) / SUM(SUM(1)) OVER ()
    


    **Check out my Domo Tips & Tricks Videos

    **Make sure to <3 any users posts that helped you.
    **Please mark as accepted the ones who solved your issue.
  • Hmm... Doesn't seem to be working. It seems bizarre that this is difficult.

  • SUM(1) / SUM(SUM(1)) OVER ()
    

    SUM(1) will get you the total number of within the grouping defined on your card.

    SUM(SUM(1)) OVER ()
    

    This returns the total for your entire dataset after filtering has been applied.

    This version is simply counting the number of rows for each group and the total number of rows across the entire dataset. If you care about just counting IDs (if it may be null sometimes) you can do something like:

    COUNT(`id`) / SUM(COUNT(`id`)) OVER ()
    


    **Was this post helpful? Click Agree or Like below**
    **Did this solve your problem? Accept it as a solution!**