Cartesian Product

How to:

Reference:

Cartesian product enables you to generate a report containing all combinations of non-related records or data instances in a multi-path request. This means that if a parent segment has three child instances on one path and two child instances on another path, when CARTESIAN is ON a request that references the parent segment and both children generates 16 records. When CARTESIAN is OFF, the same request generates only three records.

For related information about controlling how selection tests are applied to child segments on independent paths, see Selecting Records for Your Report.


Top of page

x
Syntax: How to Enable/Disable Cartesian Product
SET CARTESIAN = {OFF|ON}

where:

OFF

Disables Cartesian product. OFF is the default setting.

ON

Enables Cartesian product and generates all possible combinations of non-related records.

SET CARTESIAN may also be issued within a request.


Top of page

x
Reference: Usage Notes for Cartesian Product


Example: Reporting With Cartesian Product

When CARTESIAN is set to ON, the following multi-path request produces a report containing all possible combinations of models and standards for each car:

SET CARTESIAN=ON
TABLE FILE CAR
PRINT MODEL STANDARD
BY CAR
IF CAR EQ 'JAGUAR'
END

The output in an EBCDIC environment is:

CAR               MODEL                     STANDARD                  
---               -----                     --------                  
JAGUAR            V12XKE AUTO               POWER STEERING            
                  V12XKE AUTO               RECLINING BUCKET SEATS    
                  V12XKE AUTO               WHITEWALL RADIAL PLY TIRES
                  V12XKE AUTO               WRAP AROUND BUMPERS       
                  V12XKE AUTO               4 WHEEL DISC BRAKES       
                  XJ12L AUTO                POWER STEERING            
                  XJ12L AUTO                RECLINING BUCKET SEATS    
                  XJ12L AUTO                WHITEWALL RADIAL PLY TIRES
                  XJ12L AUTO                WRAP AROUND BUMPERS       
                  XJ12L AUTO                4 WHEEL DISC BRAKES       

When CARTESIAN is set to OFF (the default), the same request results in a report from the CAR data source containing a list of models and standards without logical relationships.

The output in an EBCDIC environment is:

CAR               MODEL                     STANDARD                  
---               -----                     --------                  
JAGUAR            V12XKE AUTO               POWER STEERING            
                  XJ12L AUTO                RECLINING BUCKET SEATS    
                  .                         WHITEWALL RADIAL PLY TIRES
                  .                         WRAP AROUND BUMPERS       
                  .                         4 WHEEL DISC BRAKES       

Information Builders