Home page  
Help >
MATCH Examples
Version 7.11
MATCH Examples

MATCH Examples

Suppose you want to find out if you have customers who have never bought anything:
                CLEAR A
                FILL A SALES
                MATCH A SALES THRU CUST# WITH CUSTOMERS
                FILL B CUSTOMERS
                C CUSTOMERS = A XOR B

First, make sure that A is clear. Then via the FILL and MATCH we isolate in A all the customers who have bought something. In B we isolate all the customers. The last line subtracts the two subsets so that at the end of this, if the CUSTOMERS portion of C is non-zero, it contains customers who have never bought anything.

MATCHing in the Same Table

Suppose you want to find out what else your "Blue Suit" customers are buying. You exclude customer AA0000 as that one buys large quantities of everything:

                FIND A SALES WHERE DESCR="BLUE SUIT" AND CUST# NE AA0000
                MATCH A SALES THRU CUST# WITH SALES

Now use a SHOW command to see what else the Blue Suit customers are buying:
                SHOW A SALES DESCR


MATCH When Fields Sharing The Same Data Have Different Names

An example of this can be found in the Example Data Base in the relationship between the INVENTORY and ASSEMBLIES tables.

Some of the Inventory records are marked as Make as opposed to Buy (from vendors). The manufacturing assembly trees associated with these Inventory records are stored in the ASSEMBLIES table.

All of the records that make up an assembly tree for a particular inventory item contain the inventory's ITEM# as a common identifier. This data is contained in the field called TREE in the ASSEMBLIES table.

So, a one-to-many relationship exists between INVENTORY and ASSEMBLIES. The only thing exceptional about it is that the fields that share the common data have different names. That's what the ON is for:

                CLEAR A
                FIND A INVENTORY WHERE DESCRIPTION SV JET
                MATCH A INVENTORY THRU ITEM# WITH ASSEMBLIES ON TREE

The object of this sequence is to find the assemblies tree that describes the Jet Plane. But the query was still based on something familiar rather than esoteric.

Copyright © 2019 , WhamTech, Inc.  All rights reserved. This document is provided for information purposes only and the contents hereof are subject to change without notice. Names may be trademarks of their respective owners.