Back to Recipes
Reporting & Analytics

Excel: Customer Returns

Two years of customer returns, open and closed

easy ~5 min setup 2 components

Overview

Two years of customer returns, open and closed

One row per return in the last two years: return number and status, the customer, the return, received, due, inspected and release dates, defect type and description, the customer's reference, the originating order, the return shipper and tracking numbers, freight cost and carrier, the received, approved and pending status flags, and the age in days.

Closed returns are included on purpose — a returns trend needs them. ?open_only=true narrows to the ones still outstanding.

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 ?customer=VALUE&status=VALUE.

InputWhat it does
customersubstring match on Customer Code or Customer Name
statusexact match on Return Status, e.g. "Open"
defect_typesubstring match on Defect Type
open_onlytrue = keep only returns that have not been released
max_rowskeep only the first N rows

What this installs

The Excel Data - Customer Returns 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 26 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 - Customer Returns Script Primary
Excel Export - Customer Returns ODBC Query

Use Cases

  • Track returns by defect type over a rolling two years
  • Work the open-returns queue from a refreshable sheet
  • Bring return costs into a quality review
  • Check a customer's return history before a call

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
  • Closed returns included, so trends are real
  • Age in days already computed
  • One link plus ?open_only=true gives the working queue

Configuration Steps

After installation, you'll configure:

  • Plex ODBC connection

Tags

excelpower bipower queryodbcplexreporting