Skip to content

Building a grid report: Customer Credit

From an empty grid report to a report people shape themselves: their own columns from the customer master, PULSE Dashboard filters, totals and a drill-down.

The report is called Customer Credit: customers counted and their credit limits added up, by salesperson and customer type, with any field of the customer master available to the people who use it. Open Administration → Custom Reports... to begin.

1. Write the query and run it

Press New Grid.... Give the report a Name and choose where it Appears under. Write the query and press Execute (F5). Each column alias becomes a column of the report, and its caption.

select c.cus_no, c.slspsn_no as [Salesperson], c.cus_type_cd as [Customer Type],
       1 as [Customers], cast(c.cr_lmt as decimal(18, 2)) as [Credit Limit $]
from arcusfil_sql c

On the Custom Columns tab, give Customers and Credit Limit $ an Aggregate of SUM. A new grid report starts as a Simple query: every column without an Aggregate groups the rows, cus_no included for now, and the preview on the right shows the result the report will show.

The grid report editor: the query and its rows on the left, PREVIEW and the Custom Columns tab on the right, Data source Simple query
The query and its 35 rows on the left; on the right the preview, added up by Salesperson, Customer Type and Cust #, and the column list. The footer says which PULSE Dashboard filters the grid understands.

2. Choose Dynamic query

Set Data source, above the query, to Dynamic query. Two things change: a LINKAGE DEFINITIONS section appears under the query, and the preview runs on PULSE Dashboard's grid engine with the grid button at its top right. PULSE Dashboard filters, the report's filter, drill-downs and the column chooser all work in it as they will for users.

PULSE Dashboard's grid adds up whatever columns it shows. cus_no is in the query for the link and the drill-down, not for the grid: hide it in the preview with the grid button, as on any PULSE Dashboard grid, and the rows add up by Salesperson and Customer Type.

The grid report editor after switching to Dynamic query: Linkage definitions under the query, the preview on PULSE Dashboard's grid without cus_no
Dynamic query: Linkage definitions under the query, and the preview grouped by Salesperson and Customer Type once Cust # is hidden. The status line under the preview says it now differs from the default settings.

A stored procedure cannot be a Dynamic query's source

Write the query as a select, or keep Simple query. The editor refuses the switch and says so.

3. Read the column list

The column list shows every column of the query. cus_no is listed in grey with Cust # (cus_no) in its Matrix Element column: it is PULSE Dashboard's own element, so the report takes its caption, format and aggregate from the Query Matrix, and those cells cannot be edited here. The other four are the report's own, and the line under the list counts them: 5 columns: 1 from the Query Matrix, 4 the report's own. 1 differs from the Column Standards. Clear Show Pulse's Columns on the toolbar to list only the report's own.

The column list: cus_no in grey tied to Cust #, then Salesperson, Customer Type, Customers and Credit Limit $
Field Name, Matrix Element, Abbreviated Caption, Full Caption and the rest of the Query Matrix's own properties, one row per column.

Rename a column in the query later and Execute again: the editor asks which new column replaces which previous one, and users' filters and layouts on the old name follow it.

4. Add a Custom Formula

Press Add Column. Name the column Average Credit Limit and write its formula with column captions in brackets: [Credit Limit $] / [Customers]. Ctrl+Space lists the report's columns. The dialog checks the formula before it closes, and Save checks it again. A Custom Formula is worked out in the grid after rows are added up, so its total is the formula over the totals, never a sum of averages. Give it an Aggregate to show that total.

The column list scrolled right: Average Credit Limit with Aggregate SUM and Custom Formula [Credit Limit $] / [Customers]
The formula column, with the Aggregate that shows its total.

Under the query, in LINKAGE DEFINITIONS, press Link and choose the Object: a table the Query Matrix knows, or one of PULSE Dashboard's optimized tables. PULSE Dashboard suggests a Join Condition from the keys the object and the report share, here arcusfil_sql.cus_no = q.cus_no. q is always the report's own rows; the object goes by its own name. Leave Join Mode at LEFT JOIN.

A moment after the edit, Check runs on its own and reports what the link does to the row count. Press Check to run it again at any time, and View SQL Query... to see the whole FROM clause as PULSE Dashboard runs it.

Linkage definitions with arcusfil_sql, LEFT JOIN, arcusfil_sql.cus_no = q.cus_no, and the status arcusfil_sql: one row for each row
Every field of the customer master is now a column people can add to their own grid. Check confirms the link gives one row for each row.

A LEFT JOIN gives a report row one row for each matching row of the object. AR Aging, #OPT_ARAging, has a row for every open invoice, so joining it on the customer repeats every customer with more than one open invoice. Check says so.

Check: arcusfil_sql: one row for each row. #OPT_ARAging repeats rows: 35 rows become 196.
A second link to #OPT_ARAging: 35 rows become 196.

This report adds up Customers and Credit Limit $, and each repeated row would be counted again, so Release waits until the link is put right: a Join Condition that matches one row, or the optimized table as the report's own data source. The link is removed here. Linkage definitions covers the rules.

6. Arrange the preview

Arrange the preview as people should first see the report: drag columns into order, widen them, sort, group. While the preview differs from the report's default settings, its status line says so and Reset to Default is enabled. Press Set as Default to make what the preview shows the default; otherwise Save asks whether to keep it. Default settings has the detail.

PREVIEW with Set as Default and Reset to Default on its toolbar, the grid grouped by Salesperson and Customer Type with grand totals
Grand totals: 35 customers, 2,000,032,089,993.00 of credit, an average of 57,143,773,999.80.

7. Save and release

Press Save. PULSE Dashboard checks the links and the formulas first and names anything it refuses. Back in Custom Reports the report is listed as Unreleased; press Release... and choose who can use it. Save, Release and User Control covers the dialog.

8. Add the report to a tab

Anyone granted the report adds it with a right-click on a tab: Add New Report, then the module you chose, then the report. It opens with the report's default settings. The button at the top right of the grid is the grid button every PULSE Dashboard grid has.

The Customer Credit report on PULSE Dashboard, grouped by Salesperson and Customer Type with grand totals

9. Choose columns

The grid button opens PULSE Dashboard's column chooser, as on any PULSE Dashboard grid. Its list holds the report's own columns, under the report's name as their Category, and every field of each linked table. Use the Table filter to narrow it.

The column chooser filtered to the report's own table: Credit Limit $, Customer Type, Customers and Salesperson under Category Customer Credit
Table filter on the report's own table: its columns, under Category Customer Credit.
The column chooser filtered to arcusfil_sql: the customer master's fields under Category Customer
Table filter arcusfil_sql: the linked customer master's fields.

Add a field and the grid adds it, grouping by it as it groups by every key column it shows. Here the user adds Cust Name. The customer count stays 35, because Check showed the link gives one row for each row.

The report with Cust Name added from the linked table; the grand total is still 35 customers

What a user arranges is kept with that user's PULSE Dashboard.

10. Filter the report

The report's filter button opens PULSE Dashboard's Filter Editor, which lists the report's columns and the linked fields beside PULSE Dashboard's own. Tab filters on them apply too. A filter is applied to the query's rows before they are added up.

The Filter Editor with Customer Type and Mode Include Selection
The report filtered to one customer type: 21 customers in the grand total
Filtered to one customer type: 21 of the 35 customers.

11. Drill into a row

With the report's Drilldown set to Report data source, a click on a row opens PULSE Dashboard's drill-down window on the query's rows behind it, with every column of the query. The click passes the key columns the row shows, the report's own and the linked ones, and the window's caption spells the filter out.

PULSE Dashboard's drill-down window captioned Customer Type in (1) AND Salesperson = 10964 AND Customer Type = 1 AND Cust Name = Ben Test EM10, showing the one row behind the click

Good to know

Question Answer
Can I switch back to Simple query? Yes. The links and the columns' identities stay in the report. On a released report, Save says how many users have it on their PULSE Dashboard: their grids start from the report's layout in the new data source, and what they arranged in the other comes back if the report is switched back.
Can I copy or import the report into another database? Yes. The columns keep their identities there unless another report already has them; then the copy gets new ones, and the import says so. The report opened on another database finds its columns by identity, so its layout and filter still work.
What happens to a filter on a column I remove? The report takes that condition out of its own filter and says so once. Tab filters are never changed.
Which tables can I link? Tables and views the Query Matrix knows on this ERP, and PULSE Dashboard's optimized tables.
Can a drill-down level be a Dynamic query? No. Drill-down levels run a Simple query in their own window.
What if the report shows a warning instead of rows? The report says what failed: a query that cannot run, or columns this database has not given their identity yet. The rest of the tab refreshes normally. Troubleshooting lists the messages.

Need a hand?

The PULSE support team is happy to help: call (513) 723-8095 or email [email protected].