Reuse a saved query¶
Steps¶
- Sidebar > PRIZM QUERY.
- Click Load query and pick a
.xmlquery-definition file. - Click Execute Query to run it against current data.
- To save your own work: click Save query, fill in the File name field in the
filename-prompt modal that opens first (it defaults to
[New query]/xml), and click its OK button — this is what actually triggers the browser download.
Things to watch out for¶
Save/Load is a genuine local file export/import, not a server-side named save
Clicking Save query triggers a real browser file download of the query's XML definition; there's no server-side "my saved queries" list behind it. That XML is quick to hand-edit once you have one clean example of a condition/column/aggregate shape — copying and adapting an existing fragment is often more reliable than re-driving the whole UI for a similar query.
This repo already has a library of ready-built example queries
prizm-queries/ in this repo holds saved .xml query files that are genuinely reusable
starting points, not just examples — load one, hit Execute Query, and you have a working
report immediately. A few concrete ones from that folder's README:
employer-invoice-delivery-option.xml— Employer Name/Number joined with the Employer Plus entity's Invoice Delivery field, built to check Invoice Delivery defaults at population scale (Union-fund context).employer-invoice-delivery-option-hw.xml— the H&W-fund equivalent of the query above, built against a different backing entity (see Understand fund-sharded entities for why that matters).employer-contacts-type-and-email-populated.xml— every Employer Contact row where Contact Type and Email are both populated; generalizes to any fund's contact type, not just one ticket's specific recipient type.members-with-multiple-open-ft-work-records.xml— finds members with 2+ concurrent open Full Time work records, using the distinct-count-sorted-descending workaround for PQ's lack of real GROUP BY (see the note below).
The GROUP BY workaround: sort a distinct-count aggregate descending
PRIZM Query has no working GROUP BY — a Count aggregate column doesn't actually group rows
by the other plain columns in the query. The documented workaround for "find members with 2+
of something": add a Distinct count (CNTDST) aggregate on a per-record field (e.g.
Jobsite_Name), sort that column Descending, and read down from the top of the Result
grid. Rows with a higher distinct-count value sort to the top even though the query isn't
truly grouped — reliable for small N (2, maybe 3), and expect a few fixture/system rows mixed
in near the top (e.g. "Reimbrsmnts ETF") that technically match the same conditions but aren't
real person records.
A query built for one fund can execute cleanly and still be the wrong query
Loading someone else's saved query and getting a clean Execute Query run doesn't guarantee the result is meaningful in your current Fund context — some entities (Employer Plus, most notably) are fund-sharded, and a query built in the wrong fund context returns an empty result set with no error. See Understand fund-sharded entities before trusting a loaded query's output at face value.
See Build and run a PRIZM Query for the underlying entity/column/condition mechanics these saved queries are built from.
Who can do this¶
| Role | Access |
|---|---|
| Super User | View Only |
| Business Agent | View Only |
| Management | View Only |
| Membership Staff | View Only |
| Accounting | View Only |
| Contract | View Only |
| H&W Staff | View Only |
| ETF Staff | View Only |
All 8 roles have the same View Only access to Execute Queries, and Save/Load query is part of
that same read-only surface — saving or loading a query file never touches underlying PRIZM data,
it only stores or reopens the query definition itself. Once someone has done the trial-and-error
of figuring out the right entities, field ids, and operators for a report, saving that query means
nobody has to rebuild it from scratch next time it's needed.