QUDEFINE
QUDEFINE sets and saves parameters for TM1® query sets. QUDEFINE is the equivalent of creating a query set using the View Extract dialog box.
You can run queries created with this function using the View Extract dialog box.
You can also use the query set as an argument to the QUEXPORT, QULOOP, and QUSUBSET macro functions.
This TM1 macro function is valid in Excel macros and VBA modules only.
Syntax
QUDEFINE(cube, query, range, LowLim, HiLim, SkpZeroes,
SkpCons)
Argument |
Description |
---|---|
cube |
The name of the cube to be queried. Use a server name prefix to indicate the server location. For the local server, specify local:cube. For a remote server, specify servername:cube. |
query |
The name of the query set to be saved for future use. |
range |
A range of worksheet cells that includes one column for each dimension in the cube. When you run the query, TM1 examines only the cube cells identified by the elements specified or referenced in the range. The range must contain one column for each dimension in the cube. The order of the columns must be the same as the dimensions in the cube. In each column, you specify or reference the elements to be included. To include a subset of elements, list the element names or specify a subset name. Write the name of the subset preceded by the backslash character (\). For example, \quarter specifies the quarter subset. To include all elements in a dimension (the ALL subset), leave the column blank. You can use DBR functions to populate the cells in the range. If the functions return blank values for any column in the range, QUDEFINE uses the ALL subset for the dimension associated with that column. |
LowLim |
The lowest cell value to be considered for export. |
HighLim |
The highest cell value to be considered for export. |
SkpZeroes |
Specifies whether cells containing zeroes are skipped. Specify TRUE to exclude them, FALSE to include them. |
SkpCons |
Specifies whether cells containing consolidated values are skipped. Specify TRUE to exclude them, FALSE to include them. |
Example
=QUDEFINE("local:98sales", "Topsell", Sheet1!B3:F5, 3000, 5000, TRUE, TRUE)
This example creates a query set that contains elements listed in Sheet1, in the cell range B3:F5. When you run this query, TM1 inspects only cube cells identified by these elements and exports non-consolidated values in the range 3000 to 5000.
""""&"0123"&""""