官术网_书友最值得收藏!

Working with natural hierarchies in data

Data often contains natural hierarchies. One immediate example is date/time information. The highest (or least granular) level might be year. Then comes month, then day, hour, minute, and so on. There are also natural hierarchies in other types of data. In the example we are working with in this chapter, Region, Sub-Region, and Country form a natural hierarchy in the data. We can use this natural hierarchy to change the way we view the data, with Spotfire automatically being able to group or aggregate the data at any level within the hierarchy.

Hierarchies can be configured as columns in the data or by adding multiple columns to an axis selector. I'll show the former in the Analyst client and the latter in the web client.
Add a hierarchy as a column (for Analyst clients only):

  1. From the Data menu, choose Add hierarchy....
  2. From the Available columns selector, choose the following options (in the following order):
    • region
    • sub-region
    • Entity
  3. Give the new hierarchy a name. I often choose something that really tells the user exactly what the hierarchy represents. In this case, I recommend Region-Sub Region-Country:
  1. Click OK.
  2. From the Marker by dropdown in the legend, choose the hierarchy you created in the last step:

To create a hierarchy (all clients) using an axis selector, follow these steps:

  1. Remove Entity from the Marker by selector (right-click and select Remove all).
  2. Now, choose region for Marker by.
  1. Then, add sub-region by clicking the + icon:
  1. Choose sub-region.
  2. Repeat this for Entity.
  3. Finally, create a hierarchy by right-clicking on the axis selector and choosing Create hierarchy:

We'll be experimenting with navigating the hierarchy in the next section, Gaining insight from the scatter plot.

Before we finish with this section, there are a few recommended settings that I suggest we apply for best-practice purposes.

If you're using an Analyst client, you can set the minima and maxima for the axes showing gridlines and add a horizontal line at the origin of the y-axis), as follows:

  1. Right-click on the visualization and select Properties.
  2. Select the X-axis property page and set the following options:
    • Range Min—0.00Max18.00
    • Show gridlines:

  1. Select the Y-axis property page and set the following options:
    • Range Min-2.00; Max4.50
    • Show gridlines:
  1. Select the Lines & Curves property page and set the following option:
    • Horizontal line: 0.00:
  1. Close the Properties dialog.
Setting axis ranges is not always a good idea in fact, I don't recommend it in most cases. However, in the next section, Gaining insight from the scatter plot, we'll be navigating through the years in the data to "animate" the scatter plot. Setting the axis ranges will be helpful as it will prevent Spotfire from auto-scaling them dependently on the ranges in the data. Of course, if you're using the web-based clients, you won't be able to set the axis ranges and will have to make do.

Finally, we should set the number formatting for the Total population column. This can be done in either the Analyst or web clients:

  1. Expand the data panel and right-click on the column. If you're using an Analyst client, choose Column properties, then Formatting. If you are using a web client, choose Formatting....
  2. Then, set the formatting to the short number format and 1 decimal. Here is the dialog from a web client for illustration (Analyst clients have similar options):

Notice that as you update the settings for a visualization, the changes happen immediately. The Properties dialog is not modalthis means that you can still interact with your Spotfire analysis as you adjust the properties.

The visualization should now look something like this (Analyst clients):

主站蜘蛛池模板: 遵化市| 蚌埠市| 当涂县| 亚东县| 长白| 郓城县| 祁东县| 武汉市| 通山县| 南木林县| 枣庄市| 正安县| 泰兴市| 宜君县| 嵊州市| 邳州市| 兴文县| 景宁| 巩留县| 贵州省| 砀山县| 临潭县| 建湖县| 墨竹工卡县| 灵台县| 剑川县| 陕西省| 安溪县| 巢湖市| 本溪市| 宣威市| 延吉市| 白朗县| 宜都市| 莆田市| 芒康县| 平湖市| 渭南市| 兖州市| 阿拉善右旗| 临泉县|