Combined Queries

#results

Updated over a week ago

A Combined Query is a way to have multiple Queries work in conjunction to return a single data-set.

There are 3 relationships that these combinations can have:

  1. Union Queries takes all of the information from every Query, eliminates duplicates, and returns what remains. This can be visualized by a A⋃B venn-diagram.

  2. Intersection Queries pull the overlapping information between the two Queries, and discards information unique in each Query. This can be visualized with the AB venn-diagram.

  3. Minus Queries shows the difference between two Queries by showing the rows of the first Query minus the rows of the second Query. This can be visualized by the AΔB venn-diagram. 

Example:

Query 1:  Apples; Oranges; Bananas  

Query 2:  Apples; Limes  

Union Query:  Apples; Oranges; Bananas; Limes 

Intersection Query:  Apples 

Minus Query: Oranges; Bananas

These systems all have different use-cases and strengths, but functionally they all serve the purpose to produce a single set of information pulled from a relationship of multiple Queries.

When to use a Combined Query? 

You may be reading the above and thinking Combined Queries are the answer to all of life's problems, but beware: Combined Queries can be precarious and one small slip up could send your report down hill. 

First, Combined Queries can have a severe performance impact in ETO Results, especially when several Queries are combined, or the combination Query is accompanied by several other individual Queries, as this can exponentially increase the processing required to run the report.

Secondly, Combined Queries are only helpful in specific use-cases. Often times, using a different data type (such as Unflattened), a different reporting Universe, or implementing a Merged Dimension may be the more appropriate option. The decision of whether or not to use a combined Query should be made on a case-by-case basis. 

How to Build a Combined Query? 

Step 1 – Within the Query Panel of ETO Results, select the "Add a combined query" button at the top of the panel.

Step 2 – A new window should pop up in the lower left corner. Double clicking on "Union" will cycle the type of combination between union, intersection, and minus. Selecting each combined Query element will show the Objects and filters that exist in that Query. Each will look identical to start out.

Step 3 – Customize the Result Objects to pull the data you are looking to compare.

  • Ensure that both Queries have the same Query filters. 


Tips and Best Practices

A Common use-case for union Queries will be to compile information from two TouchPoints with overlapping questions. In this case, ensure that each Results Object and Query filter tab look identical in order and element, with only the form type being different.

For Example:

  • Combined Query 1: Date Taken_3885; Meeting Location_3885; Instructor_3885

  • Combined Query 2: Date Taken_4223; Meeting Location_4223; Instructor_4223

Did this answer your question?