Cloudera Data Visualization supports measures in the trellis, for comparing
multiple measures at the same time. This feature works in bar, line, area, and grouped bar
visual types.
To implement this feature, simply add all the required measurement fields to the trellising
shelves of the visual.
Follow these steps to create a multi-measure representation of data in the World
Life Expectancy dataset.
Start a new visual based on dataset World Life Expectancy [data source
samples.world_life_expectancy].
For more information, see
Creating a visual.
In the visuals menu, choose the Lines visual type.
Populate the shelves from the available fields (Dimensions,
Measures, and so on) in the Data
menu.
Under Dimensions, select year and place it
on the X Axis shelf. Specify ascending order, and alias the
field as 'Year'.
Under Measures, select gdp_per_capita and
place it on the Y Axis shelf.
Under Measures, select life_expectancy and
place it on the Y Axis shelf.
Under Measures, select population and place
it on the Y Axis shelf.
Under Measures, select un_region and place
it on the Colors shelf. Alias the field as 'UN
Region'.
Change the calculations and alias for each of the fields on the Y
Axis using the Expression Editor:
Change gdp_per_capita to the following expression, and click
Validate & Save.
sum([gdp_per_capita] * [population]) / sum([population]) as 'GDP per Capita'
Change life_expectancy to the following expression, and click
Validate & Save.
sum([life_expectancy] * [population])/sum([population]) as 'Life Expectancy'
Change population to the following expression, and click
Validate & Save.
sum([population]) as 'Population'
In the Settings menu, open the Axes group
and select the Independent Aggregate Scale option.
Optional: In the Settings menu, open the Axes group
and select the Gridlines Enables option.
Optional: In the Settings menu, open the Axes group
and deselect the Include Y Axis Label option.
Click Refresh Visual.
The trellised line visual appears. This approach makes it easy to see the values of all
measurements along the same horizontal dimension (in this case, year).