Skip to Content
avatar image
Former Member

Percentage Distribution

Hello All,

I need to Calculate percentage distribution.

percentage distribution =  number of  "CHRG_SOLD"  for  each "CHRG_STATE_CODE"  /  total number of CHRG_SOLD in the US for the State "CHRG_STATE_CODE"

We are using SQL Server as the DB

I am providing sample data for your reference. Kindly help

CHRG_STATE_CODE            CHRG_SOLD

CA                                                52

CA                                                31

MI                                                  44

MI                                                  60

MI                                                   70

Best Regards

Sandeep

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Sep 10, 2014 at 01:30 PM

    Hi Sandeep,

    Here's what you need to do:

    1) Create a Group on the 'Country' field and suppress the Group header and footer

    2) Create a Group on the 'State' field and suppress the Group header and footer for this group

    3) Right-click the CHRG_SOLD fiel > Insert Summary > Choose 'Sum' as the summary operation > Under 'Summary Location' choose 'Group #2' > Check 'Show as Percentage of' and select 'Group #1' as the field in the drop-down.

    -Abhilash

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 10, 2014 at 01:28 PM

    Hi Sandeep,

    Create a group on Chrg_state_code

    Insert count on CHRG_SOLD for each group

    Now on group footer place below formula

    count(CHRG_SOLD,{group}) / count(CHRG_STATE_CODE)

    i.e. count of group / total count of CHRG_STATE_CODE

    -Sastry

    Add comment
    10|10000 characters needed characters exceeded