GEXQ Formula
The GEXQ formula is used to return a single value from the GEXQ (summary) portion of a query to a spreadsheet. Users may drill down on the summary value to see detailed results. The drill down results can appear in a single panel, tabbed panel, or worksheet, based on options in the user's Spreadsheet Server Settings, and how the drill down function is executed.
Note: ASHELL Statement may be added to the query, to launch an external program in place of query detail, as part of the drill down (see "SQL SHELL Function" in the Query Designer User Manual for more information).
- In Excel, select the cell where the formula is to reside, then, from the Spreadsheet Server Ribbon, select Formula Builder. The Formula Builder panel appears. Select the formula (GEXQ) in the Query Formulas tab.
 - Use the following table to enter data in the Formula Builder > GEXQ panel:
 - Click Insert. The formula is inserted in the cell, and the summary portion of the query in the 
GEXQformula is immediately executed. The true formula (GEXQ(...)) can be seen in the Excel formula bar. - Copy the 
GEXQformula to the appropriate destination cells. - To view detail records underlying a 
GEXQsummary value, select the cell containing theGEXQformula, then, from the Spreadsheet Server Ribbon, select Drill Down, or, right-click, and select Spreadsheet Server > Drill Down. The Drill Down panel appears, displaying the detail records of theGEXQsummary value, or the data is pushed to a worksheet. 
| Field | Description | 
|---|---|
Query Name  | 
Click the Browse button to navigate to, and, select the query to be executed.  | 
Worksheet  | 
Click the drop-down list, and select the worksheet destination for the formula. Defaults to the current active worksheet.  | 
Starting Cell  | 
Specify the starting cell for the template.  | 
Clear/Shift Worksheet  | 
Specify, when inserting data, whether to overwrite existing cell data in the worksheet, clear all cell data in the worksheet, insert the   | 
Field  | 
Click the drop-down list, and select the field to be used for summarizing. Only fields assigned an alias in the query appear in the list. If left blank, the system uses the   | 
Function  | 
If the   | 
Use/Parameter  | 
If applicable, specify or modify the cells containing the query parameters. A maximum of 25 parameters may be selected.  | 
Note: 
            Values to be entered in the GEXQ formula vary based on whether the GEXQ summary field is defined in the query or the formula.
            
Example: GEXQ Summary Field Defined in the Query
Note: See "Create the Summary Field" in the Query Designer User Manual for more information about creating the GEXQ summary field in Query Designer.
Example: GEXQ Summary Field Defined in the Formula Assistant
Note: 
            If the GEXQ formula is used in conjunction with data generated through a GEXD formula, and is in an adjacent column, use the Fill Down Columns option to copy the GEXQ formula to the same number of rows generated by the GEXD formula (see GEXD formulas for more information).