# Common Pie Chart scenarios: Displaying total number of surveys as a percentage by country

Some formulas are used more often than others when building Klips. In this series of articles, a Klip is built using a common set of formulas to give a better understanding of how these formulas work within a sample data set.

This Klip displays the total number of surveys as a percentage by country.

This Klip uses the SUM function. To build this Klip, you will:

• Build a Pie chart component
• Use the SUM function
• Format the result as a percentage

This Klip uses the following data source: ## Step 1: Building a Pie Chart component Note: If the column has a row header in your data source, wrap each column reference in the SLICE function. By default, the SLICE function removes the column or row header. For more information, see SLICE function.

1. Select Build a New Klip.
2. Select the Pie Chart component.
3. Select Use an existing data source from the library and select your data source.
4. From the component tree, select Klip, and type a Klip Title.

### For our example

From the component tree select the Labels sub-component.
In the formula editing toolbar

select Insert function, Data Manipulation, SLICE.
The SLICE function removes the row header by default. If your data source file does not have a row header you can omit this step.

`SLICE( values , start , end )`
With values selected select the column that contains the list of countries - Column A. SLICE( A:A , start , end )
From the component tree select the Values sub-component.
In the formula editing toolbar select Wrap current value in parenthesis. `( ... )`
With the first ... selected

select Insert function, Data Manipulation, SLICE.
The SLICE function removes the row header by default. If your data source file does not have a row header you can omit this step.

`( SLICE( values , start , end ) ... )`
With values selected select the column that contains the total number of surveys - Column B. `( SLICE( B:B , start , end ) ... )`
With the first ... selected select the mathematical operator /.
`( SLICE( B:B ) / ... ) ...`
With the first ... selected select Insert function, SUM. `( SLICE( B:B ) / SUM( data ) ... ) ...`
With data selected select Insert function, Data Manipulation, SLICE.
The SLICE function removes the row header by default. If your data source file does not have a row header you can omit this step.
`( SLICE( B:B ) / SUM( SLICE( values , start , end ) , data ) ... )`
With values selected select the column that contains the total number of surveys - Column B.
`( SLICE( B:B ) / SUM( SLICE( B:B , start , end ), data ) ... ) ...`
With the first ( selected select Evaluate current selection to verify the results are as expected.
With the Properties panel selected select percentage from the Format as drop-down list and change Decimal Places to .##2.
1. Save this Klip.