Comparing Query Results

The Compare with... tab in Query Results, as highlighted in Fig. 231, can be used to compare new query results with older ones. Currently, in order to make use of the Compare With... feature, the set of query results being compared to must be saved to an .xml file using the Save results to... feature. More details about the Save results to.. feature can be found in Section Saving Query Results.

**Compare with** tab for comparing current query results with saved results

Fig. 231 Compare with tab for comparing current query results with saved results

To see an example of how to make use of Compare with..., execute the query ’What are all the grandparent/grandson pairs?’ and save the results using the Save results to... tab.

Then, in the KB Editor, modify individual instance Chris by removing child Falon and adding child Ivan, as shown in Fig. 232.

Remove **Falon** and add **Ivan** as child to individual **Chris** in **KB Editor**

Fig. 232 Remove Falon and add Ivan as child to individual Chris in KB Editor

Save the changes to family.flr and rerun the same query. New query results should be different than before, as seen in Fig. 233.

New query results for ’What are all the grandparent/grandson pairs?’ after **Darryn** is removed

Fig. 233 New query results for ’What are all the grandparent/grandson pairs?’ after Darryn is removed

Click the Compare with... tab. Then navigate to the previously saved query results. Select to open it to do the comparison with, as seen in Fig. 234.

Select previously saved results for comparsion

Fig. 234 Select previously saved results for comparsion

A new tab is generated in Query Results for the comparison, as highlighted in Fig. 235.

A new tab is added to **Query Results** for the comparsion results

Fig. 235 A new tab is added to Query Results for the comparsion results

Click to open the new tab. Differences between the new and saved results are displayed in the main window. Across the top are the number of added, deleted and retained results, the location of the saved results being compared with, and the name of the comparison query tab. Comparison query tabs show added and deleted results by default. The added results are in green, while the deleted results are in red, as shown in Fig. 236.

Comparison to saved query results - additions are in green and deletions in red

Fig. 236 Comparison to saved query results - additions are in green and deletions in red

To see all comparison results including the retained results, check the Retained checkbox next to the Added and Deleted checkboxes. The retained results appear in blue, as shown in Fig. 237.

Comparison results including **Added**, **Deleted** and **Retained** records

Fig. 237 Comparison results including Added, Deleted and Retained records

Similar to other query results, comparison query results are by default sorted in ascending order by the first column variable. Within the same rank order, added and deleted results are displayed before retained results. In our comparison example, results are initially sorted by ?Grandparent. Among the results which have Aaron as grandparent, the added Aaron / Ivan result is displayed before the retained Aaron / Darryn result. This can be seen in Fig. 237.

To see results ordered by another column variable, click the corresponding column header. For example, Fig. 238 shows the comparsion results sorted in ascending alphabetical order by ?Grandson, after clicking the column header ?Grandson once.

Comparison results sorted by **?Grandson** instead of **?Grandparent**

Fig. 238 Comparison results sorted by ?Grandson instead of ?Grandparent

Sort order is reversed if the same column header is click again. For example, click the column header ?Grandson again and the comparison results will be ordered by ?Grandson in descending alphabetical order, as seen in Fig. 239.

Comparison results sorted by **?Grandson** in descending alphabetical order

Fig. 239 Comparison results sorted by ?Grandson in descending alphabetical order