Assigning queries
Procedure
Results
- The data source schema name
- The context displayed with a dollar sign ($)
- The query name

Example: Recursive level and recursive segments
For each parent query, you can extract all of the child requirements, and for each child requirement, extract its child requirements without adding each query to your template.
- [$1] Query1/Query2/Query3 to extract the Query3.
- [$2] $1/Query4/Query5/Query6 to extract child requirements of each Query3.
- [$3] $2/Query4/Query5/Query6 to extract child requirements of each child requirement of each Query3.
- Add the Query1/Query2/Query3/Query4/Query5/Query6 query to an element.
- Add values to the Recursive Level and Recursive Segments properties:
- For the Recursive Level property, enter 4.
Recursive Level represents how many levels deep the query is. If you enter a value of one or higher, you must also set a value of one or higher for the Recursive Segments property.
- For the Recursive Segments property, enter 3. Recursive Segments represents how many times the segments repeat in the query. The segments in this example are Query4/Query5/Query6.Note: The number entered for the Recursive Segments property cannot be higher than the number of segments that the query contains. The parent query is not included as a segment.
- For the Recursive Level property, enter 4.
- Run the report to test.On running the report, these queries are included:
- [$1] – Query1/Query2/Query3/Query4/Query5/Query6Note: The first query must include the full context for the query.
- [$2] – $1/Query4/Query5/Query6
- [$3] - $2/Query4/Query5/Query6
- [$4] – $3/Query4/Query5/Query6
If you find that the number entered for the Recursive Segments property is higher than the number of segments that the query contains, you can use one of these two options to resolve the issue:- Select the element that has the Recursive Segments property applied. In the Properties view, select the Data tab and decrease the value for the recursive segments property.
- You can also redesign the query to start from a different parent query. If your Recursive Segments value is one segment too high, create a container element and add a query that is one level higher than the parent query of the existing element. Then move the existing element into the container element.
- [$1] – Query1/Query2/Query3/Query4/Query5/Query6
What to do next
You can search for a list of variable assignments, attributes, and queries used in an element by right-clicking an element and selecting . The Search view opens and a list displays. You can double-click an item in the results to edit it.
You can locate a query or attribute in the Data Source View from the element it is applied to by right-clicking an element and selecting . The Data Source View opens and the query or attribute is highlighted.