You are here: Commands > Group > Nested Groups

Nested Groups

Nested groups refer to groups which are included within other groups. Nested groups provide a powerful way for you to control which commands are executed for which records. Most applications do not require such an advanced level of functionality, but it is available, if necessary.

As with all groups, use the End command to terminate a nested group. Analyzer starts processing the data only after all Group commands have been terminated. For example:

GROUP IF ProdCls < "05"¿

COUNT¿

STRATIFY ON QtyOH ACCUMULATE QtyOH MIN 0 MAX 100 INT 10¿

GROUP IF QtyOH > 0¿

STATISTICS ON QtyOH¿

HISTOGRAM ON QtyOH IF ProdStat = "B"¿

END¿

ELSE¿

TOTAL QtyOH¿

END¿

In this example, all of the commands from Count up to and including the next Group are executed only if ProdCls is less than 05.

The Statistics and Histogram commands are executed if QtyOH is greater than zero. However, because the second Group command is nested, the Statistics and Histogram commands are executed only for records that meet the conditions ProdCls < "05" and QtyOH > 0. Furthermore, because Histogram also has a test, it is executed only for records that meet the conditions ProdCls < "05" and QtyOH > 0 and ProdStat = "B".