Faceting by Separate Variables (GPL)

This example demonstrates how you can create facets based on separate variables, so that each facet shows the different variable information. Note that you can do something similar with nesting. See the topic Line Chart with Separate Scales (GPL) for more information.

Figure 1. GPL for faceting by separate variables
* Open sample file Employee Data.sav.
GGRAPH
  /GRAPHDATASET NAME="graphdataset" VARIABLES=jobcat salary salbegin
  /GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
  SOURCE: s=userSource(id("graphdataset"))
  DATA: jobcat = col(source(s), name("jobcat"), unit.category())
  DATA: salary = col(source(s), name("salary"))
  DATA: salbegin = col(source(s), name("salbegin"))
  ELEMENT: schema(position(bin.quantile.letter(jobcat*salbegin*"Beginning Salary"+
                                               jobcat*salary*"Current Salary")))
END GPL.
Figure 2. Faceting by separate variables
Faceting by separate variables