> ## Documentation Index
> Fetch the complete documentation index at: https://learn.nextedy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Query Guides

> These guides cover the Nextedy POWERSHEET query system -- the mechanism that controls how data is fetched from Siemens Polarion ALM and presented in your sheet.

export const LastReviewed = ({date}) => {
  if (!date) return null;
  const formatted = new Date(`${date}T00:00:00Z`).toLocaleDateString("en-US", {
    year: "numeric",
    month: "long",
    day: "numeric",
    timeZone: "UTC"
  });
  return <p className="mt-10 text-sm text-gray-400 dark:text-zinc-500 not-prose">
      Last reviewed on {formatted}
    </p>;
};

<Frame>
  <img src="https://mintcdn.com/none-17b4493f/3Zik2OH750CE3kB4/powersheet/diagrams/guides/queries/index/diagram-1.svg?fit=max&auto=format&n=3Zik2OH750CE3kB4&q=85&s=f52fe2e586b34525e7b67c58267052ff" alt="diagram" style={{ width: "800px", maxWidth: "100%" }} width="800" height="220" data-path="powersheet/diagrams/guides/queries/index/diagram-1.svg" />
</Frame>

## Topics

<Columns cols={3}>
  <Card title="Write an Entity Query" icon="file" href="/powersheet/guides/queries/write-entity-query">
    Define a source query that fetches entities from your data model into the sheet. Covers `from`, `where`, and basic query structure in the `sources` section.
  </Card>

  <Card title="Use Predicates" icon="file" href="/powersheet/guides/queries/use-predicates">
    Filter query results using equality, comparison, and logical operators in your source `where` clause to narrow down returned work items.
  </Card>

  <Card title="Expand Navigation Properties" icon="file" href="/powersheet/guides/queries/expand-navigation-properties">
    Load related entities through expansion paths for hierarchical sheet display. Traverse data model relationships like `UserNeed` to `SystemRequirement`.
  </Card>

  <Card title="Filter by Document" icon="file" href="/powersheet/guides/queries/filter-by-document">
    Restrict query results to work items within a specific Polarion LiveDoc. Use document constraints and the `applyCurrentDocumentTo` setting.
  </Card>

  <Card title="Query Baseline or Revision" icon="file" href="/powersheet/guides/queries/query-baseline-revision">
    Fetch historical data from specific project baselines or revisions instead of current data, enabling point-in-time traceability views.
  </Card>

  <Card title="Optimize Queries" icon="file" href="/powersheet/guides/queries/optimize-queries">
    Improve query performance for large datasets and complex expansion paths. Learn about query structure best practices and efficient predicate usage.
  </Card>
</Columns>

<Accordion title="Queries live in the sources section">
  All query settings are defined inside the `sources` section of your sheet configuration YAML. Each source specifies a `query` with `from` (entity type), `where` (filter predicates), and `expand` (navigation properties to load). See [Configure Sources](/powersheet/guides/sheet-configuration/configure-sources) for the full configuration reference.
</Accordion>

## Recommended Reading Order

If you are new to Powersheet queries, follow this sequence:

| Step | Guide                                                                                   | What You Learn                                            |
| ---- | --------------------------------------------------------------------------------------- | --------------------------------------------------------- |
| 1    | [Write an Entity Query](/powersheet/guides/queries/write-entity-query)                  | Basic query structure and the `from` / `where` pattern    |
| 2    | [Use Predicates](/powersheet/guides/queries/use-predicates)                             | Filtering with operators and compound conditions          |
| 3    | [Expand Navigation Properties](/powersheet/guides/queries/expand-navigation-properties) | Loading related entities through data model relationships |
| 4    | [Filter by Document](/powersheet/guides/queries/filter-by-document)                     | Scoping results to a LiveDoc context                      |
| 5    | [Query Baseline or Revision](/powersheet/guides/queries/query-baseline-revision)        | Accessing historical snapshots                            |
| 6    | [Optimize Queries](/powersheet/guides/queries/optimize-queries)                         | Performance tuning for production sheets                  |

## See Also

* [Configure Sources](/powersheet/guides/sheet-configuration/configure-sources) -- define data sources in sheet configuration YAML
* [Data Model Guides](/powersheet/guides/data-model/index) -- set up entity types and relationships that queries target
* [Query API Reference](/powersheet/reference/query-api/index) -- technical reference for query parameters and operators
* [Troubleshooting Guides](/powersheet/guides/troubleshooting/index) -- resolve query-related errors

<LastReviewed date="2026-06-08" />
