How to calculate shares?

I'm looking to estimate how some of the industry measures are distributed by industry. I'd also like to calculate regional distributions. How might I add a calculation of shares in Data Library?

Was this post helpful?
1 out of 1 found this helpful


1 comment

  • Hello,

    Once you've built your Explore query by applying the appropriate filters (perhaps by your Region) and selected the Dimension you'd like to estimate the distribution across (perhaps Industries), along with Measure(s) you'd like to estimate the distribution of (such as Employment, Output, Value Added etc.) you are ready to add a Table Calculation

    For the share that the selected Measure in each row makes up of the column total, use the following formula and checking the "Totals" box:

    ${insert measure title}/${insert measure title:total}

    In a more complex query, the shares across a pivoted Dimension can be calculated by checking the "Row Total" box along the top of the Data query field, then add this formula as a Table Calculation:

    coalesce(pivot_index(${insert measure title},1),0)/${insert measure title:row_total}

    The "1" above refers to the column number, so this calculates the percentage of the row total that column 1 makes up. Add Table Calculations and adjust this figure as necessary for additional shares, such as the percentage that column 2 makes up and so on. 

    Thank you,


Please sign in to leave a comment.