ProcessSequenceNum (Property)

Applies To:

(CubeQuery) QuerySection object, OLAPQuerySection Object QuerySection object

Description:

Sets the ordinal equivalent to a query position in the Query Processing Order dialog. That is, when the query is listed first in the list box, the ProcessSequenceNum is one (1). When it is listed second, this property is two (2) and so on.

This property may be used in association with the IncludeInProcessAll (Property). The value selected here is relevant even if the IncludeInProcessAll (Property) is false.

A catchable exception is thrown if the value to be assigned is less than 1. If the user-assigned value is higher than the count of Query sections in the document, it is silently reset to be equal to the count assigned by the QueryCount (Property).

When ProcessSequenceNum (Property) is assigned to a query section, the Query section that previously had this value and all subsequent or preceding Query section, have their ProcessSequenceNum (Property) incremented or decremented by one (1). This recalculation fills in the gap left by the old sequence number of the selected Query section. For example, if QueryA, OLAPQueryB, and Query C have the property values set to 1, 2, and 3 respectively, these recalculations occur:

The Boolean value selected for this property is the equivalent of the asterisk (*) in the Query Processing Order dialog. Use this property to return or set the value of the IncludeInProcessAll (Property) .

If this property is true, the query is processed in the order specified by the ProcessSequenceNum (Property) or as specified on the Query Processing Order dialog when a Process All action is requested.

If this property is false, the query is not included in the Query Processing Order.

When a job is published or scheduled, all queries are listed in the Connecting to Data Sources section in order by the ordinal value of the ProcessSequence Num (Property), regardless of the setting for the IncludeInProcessAll (Property). Queries with the IncludeInProcessAll property set to true are not listed in the Query Connections and Processing section. When the script is generated for the job, the processing actions is in ProcessSequenceNum order, excluding queries where IncludeInProcessAll (Property) is false.

When scheduling/running a job, if a query has IncludeInProcessAll (Property) set to false, but it is used in other queries as a derived table, and the excluded query has variable limits, its parameters are requested for each query that uses it. For example, Query 1 is excluded from the processing order, but Query 2 and Query 3 use it as a derived table. When collected parameters for Query 2 and Query 3, Query 1 should be included. Different parameter values could be selected for each of these queries.

When a custom process order is selected from the Process Custom dialog, all queries belonging to a given node of the processing tree (Queries, OLAPQueries, and Imported Files being the nodes) are arranged in order by the ordinal value of ProcessSequenceNum (Property), regardless of the setting of IncludeInProcessAll. Queries that are checked in that dialog box are processed in ProcessSequenceNum order, regardless of the Query type. For example, assume a document with Query2, OLAPQuery1, authorsout.csv, Query1, and OLAPQuery2, are assigned sequence numbers 1 to 5. They appear in the tree as Query2 and Query1, in that order under Queries, and OLAPQuery1 and OLAPQuery2 under the OLAP Queries branch, and authorsout.csv under Imported Files.

If a user checked all five and clicks OK, this is the process order

If a query section has the IncludeInProcessAll (Property) set to false, clicking the Process button when viewing that section or any of its dependent sections or execution of the Process (Method) associated with that section still processes that query.

When a query section is duplicated, the new section gets the next highest ProcessSequenceNum, and it appears last in the Query Processing Order dialog list box if it is opened immediately following the duplicate section action. The IncludeInProcessAll boolean value is inherited from the source section during duplication.

Action:

Read-write, numeric

Example 1:

This example shows how to display the number of queries in the Interactive Reporting Reporting document (.bqy) file in an Alert box, set the processing the Query section to the second position in the Query Processing Order dialog, includes the Query section in a Process All command, and then execute the Process All command for the document:

Alert("Number of Query Sections "   +  ActiveDocument.Sections.QueryCount)
ActiveDocument.Sections["Query"].ProcessSequenceNum = 2
ActiveDocument.Sections["Query"].IncludeInProcessAll = true
ActiveDocument.ProcessAll()

Example 2:

This example shows how to set a query to process first in the query processing order:

var procSeqNum = Sections[“Query”].ProcessSequenceNum;

// Make this query get processed first
Sections[“Query”].ProcessSequenceNum = 1;