cancel
Showing results for 
Search instead for 
Did you mean: 

Percentage Distribution

nsandee
Participant
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

abhilash_kumar
Active Contributor
0 Kudos

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

Answers (1)

Answers (1)

former_member205840
Active Contributor
0 Kudos

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