59.1.4 Query Tutorial: The Funnel Concept
Now let's get a mental picture of what happens when you add lines to a query in the Query Editor. Take a look at the diagram below:
This is what we call the Funnel Concept. This concept is a visual way for you to understand that, for each line you add to a Query, the following rules hold true:
If the conjunction is Or, the selection may get larger, but it will never get smaller;
If the conjunction is And, the selection may get smaller, but it will never get larger;
If the conjunction is Except, the selection may get smaller, but it will never get larger.
Just to see how this works, let's take the two-line query that we have already saved, and let's see what happens as the we change the conjunctions.
QUERY [Location] AND [Location]Demog_Last_Name #Jones
QUERY [Location] AND [Location]Stay_Days > 10
As we go through the queries, we will perform each query as a one-line query so we can see the results. To save time and space, we will only show the number of records that the query returned.
Note: Because your data file may not be exactly the same as the data file that we used in these examples, the number of records that your queries return might be different from those shown below. The important factor is the relative number of records returned, not the exact numbers.
OK, let's see what happens as we add the second line to the first line in three separate queries, each time changing the conjunction. We start with And:
Compared to the one-line result, the funnel became smaller.
But if we use the same query again, and just change the conjunction to Or:
Compared to the one-line result, the funnel became larger.
Now: what do you think will happen if we change the conjunction to Except?
Compared to the one-line result, the funnel became smaller.
By the way: you may wonder why we have explained the Funnel Concept so thoroughly by repeating ourselves in a slightly different way. The reason is this:
Having a thorough understanding of the Funnel concept is essential if you want to become a power user of the STATIC Query Editor!
Query Tutorial: Query Line Order and the Funnel Concept
You need to know how the Query Line Order can affect the results. Let's use three query lines to build some tests. Our three query lines are:
So let's experiment. The And-And order will be our starting point. Our test will be to see what happens if we change the order to Or-And, to And-Or, and to Or-Or.
In each case, we will show you the Query Editor, and then the number of records that result from that query.
Can you guess a General Rule that is implied by these results?
Here is the rule: The later the Or in the query order, the more records the query will return.
|