Back to Recipes
Reporting & Analytics

Excel: Scrap by Workcenter & Reason

Two years of scrap rolled up to workcenter and reason

easy ~5 min setup 2 components

Overview

Two years of scrap rolled up to workcenter and reason

Rolling twenty-four months of scrap, summed by workcenter and scrap reason: workcenter name and code, the reason, scrapped quantity, weight and extended cost, the event count, and the first and last event dates in the window.

Workcenter is coalesced to (Unassigned) rather than dropped, so scrap recorded without a workcenter still shows up instead of quietly vanishing from the total.

How to connect it

Open the script, click Connect to Excel and copy the link. In Excel, Data → From Web, paste, choose Anonymous, and Load. From then on Refresh All re-runs the query — there is no exported file to hunt down, nothing is scheduled and nothing is emailed around.

How current is it?

This table reads Plex over its ODBC reporting connection, not the live transactional system. That copy can trail production by up to about four hours, so treat the numbers as recent rather than real-time. Refreshing re-runs the query, but it re-runs it against the same reporting copy — it does not reach past it.

That is the right trade for reporting, review meetings and models. Anything that has to be accurate to the minute — shipping a container, releasing a job — belongs in Plex itself, not in a workbook.

Filters

Every input is an optional URL query parameter on the link, so one script serves a whole team: two sheets can be the same feed with different values. For example ?workcenter=VALUE&scrap_reason=VALUE.

InputWhat it does
workcentersubstring match on Workcenter or Workcenter Code
scrap_reasonsubstring match on Scrap Reason
min_qtykeep only rows scrapping at least this quantity
max_rowskeep only the first N rows

What this installs

The Excel Data - Scrap by Workcenter and Reason script and one saved SQL query it runs on. The SQL lives in the SQL editor, so a column you want added is an edit in one place that every workbook picks up on its next refresh. The table has 9 columns as shipped, and no row cap — a cap would truncate silently and the workbook would look complete.

What you need

One ODBC credential pointed at your Plex reporting connection. The install wizard asks for it once and applies it to the query. If you do not have one yet, create it first in Script Engine → Credentials with type odbc.

What's Included

Excel Data - Scrap by Workcenter and Reason Script Primary
Excel Export - Scrap by Workcenter and Reason ODBC Query

Use Cases

  • Run a Pareto on scrap reasons without exporting anything
  • Track scrap cost by workcenter month over month
  • Pair against production volume for a scrap rate
  • Bring current numbers into a quality review deck

Install This Recipe

Sign in to your DataMagik workspace to install this recipe.

Sign In to Install

Benefits

  • Re-queries the source on refresh instead of holding an emailed copy
  • Extended cost is already summed, not a lookup per row
  • Unassigned scrap is kept, so totals reconcile
  • Rolled up in SQL, so the workbook loads fast

Configuration Steps

After installation, you'll configure:

  • Plex ODBC connection

Tags

excelpower bipower queryodbcplexreporting