The Add button acts something like the Edit button, but instead of opening the Microsoft Access Query Designer with the SQL of the current Worksheet step (Q1-Q7), it starts a new query at the end of the "Q chain". If there are already 4 steps in the Worksheet, the new query will be named Q5 and it will start out by grabbing everything it can from the previous query; in other words, it will look like this: SELECT elfQ4.* FROM elfQ4;
This is simply a starting point for your own query; you can add fields or tables, or use any of the other features of the Query Builder to elaborate this SQL.
While it's unlikely you'll be writing queries to tack onto the end of complex SQL chains, it's possible that you may want to back up through a series of steps and fork off at an earlier point. For instance, you might use the Drop button to delete the last two SQL steps, and click Add to start along another route. Note that you can neither Drop from the middle of a sequence of steps (you must drop at the last step); nor can you Add into the middle of a sequence (you must add beyond the end of the current sequence).
One common use of the Add button is to experiment with formatting the answer for display. Rather than changing the actual answer query (the last auto-generated query in the chain), you can copy all the necessary fields into one follow-up query. This is safe to play around with -- if you make a mistake, you can just Drop back to the original, click Add again and pick up where you left off.
For example, you might want to test various scale factors when displaying multi-value graphs. Let's try this question: Show the discount and product for each order with quantity > 75. When we graph this response, we find it's not shown in an easy-to-comprehend way. For one thing, the Discounts are completely hidden behind the Quantities. We can try to fix this by opening the Chart panel, double-clicking Discount to remove it (from the top of the value list) and clicking the Discount heading to add it back to the bottom of the list. Since we've reversed the order of values, the position of the bar graphs reverses when we click the Graph button. That succeeds in placing the Discounts in front -- but it hardly helps . . . the discount values are too small to see. Of course! That's because discounts are really percentages -- they're always between zero and one. To make the display of the two values more consistent with each other, we can scale the discount by a factor of 100.
Here's where the trick about adding a new query comes in. Rather than modifying the current query, we'll add a new query, and have it inherit all the previous query's values. Butt we'll change the Discount column to read D: Discount * 100. Clear the Chart panes (so that ELF won't go looking for Discount, when it's now called D).When we graph this query, we can see we're making progress. Moving the D value in front of Quantities gives a pretty balanced graph. We can touch it up even more by changing the scale factor to 500. That's easy to do -- just type 500 over the 100 in the SQL pane, and press Enter. Then reclick Graph Selected.
For another example of using the Add button, see this workaround for a problem with multiple aggregates.
Last Updated: March, 2002