--- title: "Use case: Analyze rework" slug: "datenaustausch-connect-api-uc-pm-nacharbeit" updated: 2026-12-02T08:12:43Z published: 2026-12-02T08:12:43Z canonical: "docs.homag.cloud/datenaustausch-connect-api-uc-pm-nacharbeit" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.homag.cloud/llms.txt > Use this file to discover all available pages before exploring further. # Use case: Analyze rework **For:** Customers · Partners · Integrators Rework costs material, machine time, and on-time delivery. To reduce it, you need to know which rework occurs most often, where it occurs, and why. ## Challenge Individual rework is handled every day in production, but patterns remain hidden: Is a particular material repeatedly damaged? Does one workstation cause most tear-outs? Is rework increasing? Without statistics, improvement measures rely on guesswork. ## Solution productionManager records each rework with its reason, category, material, dimensions, quantity, and timestamp. Your report reads rework for a time window and groups it, for example by reason, category, or material. Two endpoints are available: | Endpoint | Use for | | --- | --- | | `GET /api/productionManager/statistics/reworks` | Statistics and trends over a time window. Default: the last three months. | | `GET /api/productionManager/reworks` | Current rework, filtered by status, for example rework that still needs to be produced. | ## Workflow 1. Read rework for the time window, for example the last 90 days. 2. Group by the question you want to answer. 3. Sort groups by the sum of `quantityOfReworks`. 4. Display the results as a ranking or as a weekly trend. **C#** ```csharp var reworks = await productionManager.GetReworks(daysBack: 90); // Most common reasons var byReason = reworks    .GroupBy(r => r.Reason)    .Select(g => new { Reason = g.Key, Quantity = g.Sum(r => r.QuantityOfReworks) })    .OrderByDescending(x => x.Quantity); // Materials with the most rework var byMaterial = reworks    .GroupBy(r => r.Material)    .Select(g => new { Material = g.Key, Quantity = g.Sum(r => r.QuantityOfReworks) })    .OrderByDescending(x => x.Quantity)    .Take(10); ``` **REST** ```http GET /api/productionManager/statistics/reworks?daysBack=90 200 OK Content-Type: application/json [  {    "reworkId": "RW-2026-000184",    "capturedAt": "2026-11-18T08:14:32Z",    "id": "10705921",    "orderName": "Kitchen Block A",    "material": "W10410_W410_White",    "length": 1307,    "width": 804,    "category": "Edgebanding",    "reason": "Tearouts",    "description": "Tear-out at front edge",    "quantityOfReworks": 1,    "state": "Approved"  } ] ``` ## Typical questions | Question | Group by | | --- | --- | | What is the most common reason for rework? | `reason`, for example `Tearouts`, `Scratches`, `DimensionsNotOK`, `WrongMaterial` | | In which process does it occur? | `category`: `Dividing`, `Edgebanding`, `CNC`, `Surface`, `Other` | | Which materials are most affected? | `material` | | Is rework increasing or decreasing? | Week or month of `capturedAt` | | Which rework is still open? | `state`: `Pending`, `Approved`, `Rejected`, `Transferred` | ## Option: Analyze in Excel without programming Excel can read rework statistics directly from the API using Power Query. 1. In Excel, open the **Data** tab and select **From Web**. 2. Enter the following URL. It returns localized column names and values for the last 365 days:\   `https://connect.homag.cloud/api/productionManager/statistics/reworks?format=localized&culture=en-US&daysBack=365` 3. In the sign-in dialog, select **Basic** (German: Standard). Enter the subscription ID as the user name and an authorization key from the **HOMAG Connect productionManager** add-on as the password. See [Authentication](/docs/en/datenaustausch-connect-api-konzept-auth). 4. Click **Connect**. The Power Query editor opens. 5. Convert the list to a table, expand the columns, and select **Close & Load**. 6. Create a PivotTable, for example with the reason as rows and the sum of rework quantity as values. To refresh the data, select **Refresh All** on the **Data** tab. Adjust `culture` and `daysBack` in the URL as needed. The same URL works in Power BI. ## Integration architecture For regular reports, read the statistics on a schedule and store them in your BI tool. Use either `daysBack` or `from`/`to`, never both. Retrieve large results in pages using `take` (up to `10000`) and `skip`. To display rework that still needs to be produced, use `GET /api/productionManager/reworks` with the `state` filter. ## Benefits - The most common causes of rework become visible. - Improvement measures can be targeted and their impact measured. - Analyze results in Excel or Power BI without programming. > **API reference:** See Endpoints → HOMAG Connect productionManager → Tracking Reworks and Rework History ([API reference](https://connect.homag.cloud/productionmanager/#v1/tag/b06-tracking-reworks-and-rework-history)): [Get rework statistics](https://docs.homag.cloud/apidocs/getreworks) ([`GET /api/productionManager/statistics/reworks`](https://connect.homag.cloud/productionmanager/#v1/tag/b06-tracking-reworks-and-rework-history/GET/api/productionManager/statistics/reworks)) and [Get current rework](https://docs.homag.cloud/apidocs/getcurrentreworks) ([`GET /api/productionManager/reworks`](https://connect.homag.cloud/productionmanager/#v1/tag/b06-tracking-reworks-and-rework-history/GET/api/productionManager/reworks)).