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.

Location

Action

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.









Klip Tutorials

  1. Introduction
  2. Introduction to the Build-a-Klip Tutorial
  3. Build-a-Klip Tutorial: Phase One
  4. Build-a-Klip Tutorial: Phase Two
  5. Build-a-Klip Tutorial: Phase Three
  6. Build-a-Klip Tutorial: Phase Four
  7. Build-a-Klip Tutorial: Phase Five
  8. Example - Revenue YTD Klip
  9. Example - Financial Performance YTD Klip
  10. Example - World News Klip
  11. Example - Bookings by Country Klip
  12. Example - Bookings QTD Klip
  13. Example - Stock Quotes Klip
  14. Example - Marketing Traffic Sources Klip
  15. Example - 75/20 Service Level - Today Klip
  16. Training Klip - Array, Slice, Reverse, If, and Trim Functions
  17. Training Klip - Sum, Average, and Count Functions
  18. Training Klip - Group and Groupby Functions
  19. Training Klip - Date, Datevalue, and Today Functions
  20. Training Klip - Replace function and image URLs
  21. Training Klip - Concat and Join Functions
  22. Common Bar/Line Chart scenarios: Example of using the LOOKUP function with a condition to align data
  23. Common Bar/Line Chart scenarios: Example of using the LOOKUP function to align data
  24. Common User Input Control scenarios: Displaying total boxes of fruit sold in the last three months
  25. Common User Input Control scenarios: Counting all tickets by quarter, by month, by weekday
  26. Common Table scenarios: Selecting start and end dates to display number of boxes sold by country
  27. Common Table scenarios: Sorting data to display the video with the highest number of views
  28. Common Pie Chart scenarios: Displaying total number of surveys as a percentage by country
  29. Common Pie Chart scenarios: Displaying numbers and percentages in a pie chart legend

Feedback and Knowledge Base