Error: A selection can only be created for a query containing an aggregate when the query's primary key field is included in the output.

When attempting to save a selection for a query, the below message appears:

"A selection can only be created for a query containing an aggregate when the query's primary key field is included in the output."

For example, you are under Analysis > Query and have added a new query. On the Set Save Options tab you have checked the box, "Save a selection" and then the error occurs after clicking "Save."
To resolve the issue, add the "Primary key" field to the output of the query results. First open your query to edit, then follow the below steps to add the Primary keys to your results:

Constituent Query
  1. In the left column, select Constituents. From the middle column, drag Constituent record into Results fields to display.
  2. On the Set Save Options tab, attempt to save the query and Create a selection again

Revenue Query
  1. In the left column, select Revenue. From the middle column, drag Revenue record into Results fields to display
  2. On the Set Save Options tab, attempt to save the query and Create a selection again

Sales Orders Query
  1. In the left column, select Sales Orders. From the middle column, drag Sales order record into Results fields to display.
  2. On the Set Save Options tab, attempt to save the query and Create a selection again

Registrants Query
  1. In the left column, select Registrants. From the middle column underneath System Fields, drag System record ID into Results fields to display.
  2. On the Set save options tab, attempt to save the query and Create a selection again

Reservation Query
  1. In the left column, select Group Sales Reservations. From the middle column in the Reservation Record group, drag Reservation Record into Results fields to display.
  2. On the Set save options tab, attempt to save the query and Create a selection again.

Environment

 2.92

Was this article helpful?


Thanks for your feedback! Did this solve your issue?

Comments (optional):


Thanks for your feedback!
We're glad it was helpful but sorry it didn’t solve your issue. If you need assistance, click Chat with Support below.
We’re sorry to hear that. Please tell us why.

 I don't like how this works.

 The answer is confusing.

 The answer didn't match what I was searching for.

Additional Comments (optional):


Thanks for your feedback! If you need assistance, click Chat with Support below.
Thanks for your feedback. Help us make our products even better by sharing details in our Idea Banks or our online Community.
Thanks for letting us know. We'll work on clarifying the information in the article. If you need assistance, click Chat with Support below.
Thanks for letting us know. We'll work on updating the search engine to return more relevant results.