Task 6: Map the data set values to the Flash map entity values
To display data from the data set in the Flash map, you need to map the territory values in the data set to the internal ID values used by World Map.
1 In Data Explorer, under Data Sets, right-click Sales By Territory, then choose Edit.
2 In Edit Data Set, choose Computed Columns, then choose New.
3 In New Computed Column, specify the following information:
1 In Column Name, type Territory_ID.
2 In Data Type, select String.
3 In Expression, choose the JavaScript expression builder.
4 In the expression builder, type the following statement, then choose OK.
Each case statement replaces a territory value with the corresponding internal ID used by the map.
switch(row["TERRITORY"]) {
case "EMEA":
name = "EU";
break;
case "APAC":
name = "AS";
break;
case "Japan":
name = "AS";
break;
case "NA":
name = "NA";
break;
}
5 Choose OK.
4 Choose Preview Results. The data set returns the data shown in
Figure 15‑16. The Territory_ID values match Internal Id values in World Map.
Figure 15‑16 Sales By Territory data set preview includes Territory_ID values
5 Choose OK.