Grouped bars

CDP Data Visualization, enables you to create Grouped Bar visuals. While bar charts show comparisons among categories, grouped bar charts show clustered groups of related measurements as bars.

The following steps demonstrate how to create a Grouped Bars visual representation of ethnic distribution of population in some US counties. The example is based on the US Counties dataset . For more information, see Adding data and Creating a dataset.

For an overview of shelves that specify this visual, see Shelves for grouped bars.

  1. Start a new visual based on dataset US Counties.
    For instructions, see Creating a visual.
  2. In the VISUALS menu, find and click Grouped Bars.

    The shelves of the visual changed.

    The mandatory shelves are X Axis and Y Axis. The fields placed on these two shelves may be easily swapped by switching X and Y. Doing this produces a horizontal chart.

  3. Populate the shelves from the available fields (Dimensions, Measures) in the DATA menu.
    1. Under Dimensions, select the Ctyname field and drag it to the X Axis shelf.
      At this point, it is recommended that you alias the field as County. For more information, see Alias.
    2. Select the Wa male field and drag it to the Y Axis shelf.
      This first measurement provides the axis definition.
    3. Add the other measurements to the Colors shelf.

      Together with the measurement on the Y Axis, this creates the 'group' Cloudera Data Visualization uses to draw grouped bars.

      For this example visual, add Ba Male, Ia Male, Aa Male, Na Male, and Tom Male.

    4. On the Y Axis shelf, click the field, and from the FIELD PROPERTIES menu, select [ ] Enter/Edit Expression.
    5. In the Enter/Edit Expression modal window, edit the expression to the following:
      sum([Wa Male]) + sum([Wa Female])

      Click VALIDATE EXPRESSION, and then click SAVE.

    6. Repeat the change in the expression on all the fields placed on the color shelves.
      sum([Ba Male]) + sum([Ba Female])
      sum([Ai Male]) + sum([Ai Female])
      sum([Aa Male]) + sum([Aa Female])
      sum([Na Male]) + sum([Na Female])
      sum([Tom Male]) + sum([Tom Female])
    7. Alias the field on the Y Axis shelf as 'White', and alias the fields on the Colors shelf as 'Black or African American', 'American Indian and Alaska Native', 'Asian American', 'Native Hawaiian and Other Pacific Islander', and 'Two or More Races'.
    8. Add the field Stname to the Filters shelf and select the value 'Alaska'.
  4. Click REFRESH VISUAL.

    The Grouped Bars visual appears.

  5. Click the (pencil) icon next to the title of the visualization to edit it, and change the title to World Population - Grouped Bars.
  6. At the top left corner of the Dashboard Designer, click SAVE.