Data sources and links¶
Where a grid report's or a graph's rows come from, in Macola® or in any other database PULSE Dashboard can read, what each choice gives the people who use the report, and how Linkage definitions join other tables to those rows.
Data source sits on the editor's header, beside the report's name, because it belongs to the report: only the report's own level has one, and drill-down levels always run a Simple query. It offers three choices.
| Data source | Rows come from | What users get in the report |
|---|---|---|
| Simple query | A query you write | The query's columns, arranged as you arranged them |
| Dynamic query | A query you write, plus linked tables | Their own choice of columns from the query and every linked table, in the column chooser; PULSE Dashboard filters on any of them |
| Optimized table | One of PULSE Dashboard's optimized tables, with no query to write | As a Dynamic query, starting from every column the table can carry |
Simple query¶
The query's result is the report. Every column of the result is a column of the grid report, or a field a graph can draw, with the caption, format and aggregate you set on Custom Columns. A column named after a Query Matrix element, such as cus_no, answers PULSE Dashboard filters and is passed by a click; the footer names those columns: Pulse filters understand Cust #. A row click passes Cust #.
When any column has an Aggregate, the report groups the rows by the columns that have none and adds the others up. Filters apply to the query's rows before they are added up, so every row of the grid has rows behind it. View SQL Query... on Custom Columns shows the SQL the grid runs. With no Aggregate, the grid shows the query's rows as they are.
A stored procedure can be a Simple query's source. It takes PULSE Dashboard filters only through its @@ placeholders, and its rows cannot be added up by an Aggregate: Save refuses with a stored procedure's rows cannot be added up by an Aggregate. Clear the Aggregate of every column, or write the query as a select.
Dynamic query¶
The query is the base, and users build on it. Each column of the report becomes an element of its own, named with a prefix PULSE Dashboard takes from the report's ID, such as cr67ec07. There is nothing to type, and the names are the same in every database the report is synced or imported to. In the editor, choosing Dynamic query shows the LINKAGE DEFINITIONS section under the query and runs the preview on PULSE Dashboard's grid engine, so the preview behaves exactly as the report will on a user's PULSE Dashboard.
What changes for users:
- The report's grid button opens PULSE Dashboard's column chooser, listing the report's columns under the report's name as their Category, and every field of each linked table under that table's own Category.
- The grid adds up whatever it shows. A column with an Aggregate is added up; a column without one groups the rows. Hide a key column and the rows add up without it.
- PULSE Dashboard filters understand every column of the query and every field of the linked tables, and a filter applies to the query's rows before they are added up. The footer says so: Pulse filters understand every column of the query and every field of arcusfil_sql. Cust # is Pulse's own, and filters as Pulse's. A row click passes the key columns it shows.
- A column that is a Query Matrix element keeps PULSE Dashboard's caption, format and aggregate. Custom Columns explains the tie and how to untie it.
A graph on a Dynamic query draws the rows of the same view: a linked field can be its X Axis, and a PULSE Dashboard filter on any field of the query or its linked tables filters it. Graphs has the rest.
A Dynamic query cannot be a stored procedure: A stored procedure's rows cannot be a Dynamic query's source: write the query as a select, or choose Simple query.
Optimized table¶
Choose Optimized table and type to find one of PULSE Dashboard's optimized tables, such as #OPT_ARAging or #OPT_CustomerOrdersYear. Every plain column of the table is the report's: available in the column chooser, to filters, to Custom Formulas and to links. There is no column choice to make, so Remove Column says to hide a column in the preview instead.
PULSE Dashboard builds only the columns in use: those shown, filtered or sorted, those a link joins on and those a Custom Formula names. A column a user brings in from the column chooser is built at the next refresh. The report's starting layout shows the table's key columns, with the rest waiting in the column chooser; a table of up to 60 columns shows them all.
Every column of an optimized table is a Query Matrix element, so the column list shows them in grey with PULSE Dashboard's settings, and Show Pulse's Columns starts cleared for this data source. Each person's table is built from their own User Date and selections, such as the date AR Aging is aged to, so two people can see different values.
A shared optimized table rebuilds for everyone
Some optimized tables are shared between the reports on a tab. Asking one for a column it does not hold yet rebuilds it for everyone using it. The Linkage definitions status line says so when that applies.
Data from outside Macola®¶
A custom report can show data that is not in Macola®. Its query runs on PULSE Dashboard's own connection to SQL Server, so it can read any table or view that connection is allowed to read, whichever database it is in. The Query Analyzer runs on the same connection and reaches the same data.
- A table in the company database that is not Macola®'s, such as one another program writes to, is named in the query as it is.
- A table in another database on the same SQL Server is named with its database in front:
OtherDB.dbo.shipments. PULSE Dashboard's SQL Server login has to be allowed to read that database; when it is not, SQL Server refuses the query with a message that the login cannot access the database, and your database administrator can give it read access. - A stored procedure in another database can be a Simple query's source the same way:
exec OtherDB.dbo.open_picks. - Data held anywhere else, such as on another SQL Server, in a spreadsheet or in another program's files, has to be made readable on this SQL Server first, for example as a table your database administrator loads it into or through a linked server. The report then reads it there.
Join the outside data to Macola® in the query itself. Linkage definitions offer only the Macola® tables PULSE Dashboard knows and its optimized tables, so a table from another database cannot be added as a link.
select c.cus_no, c.cus_name, s.carrier, s.ship_dt
from arcusfil_sql c
join OtherDB.dbo.shipments s on s.cus_no = c.cus_no
In a Simple query, PULSE Dashboard filters understand a column only when it is named after a Query Matrix element, so give the column that holds a customer number the name cus_no, as above. In a Dynamic query they understand every column of the query.
Switching data source on a released report¶
Save asks before it writes: The data source changes from Simple query to Dynamic query. 4 users have it on a dashboard. Their grids start from the report's layout. What they arranged with the Simple query is kept, and comes back if the report is switched back. Save? The links and the columns' identities stay in the design, so switching back and forth loses nothing.
Linkage definitions¶
LINKAGE DEFINITIONS sits under the query on the editor's left side for a Dynamic query or an optimized table; a Simple query and a drill-down level have none. A link joins a table or an optimized table to the report's rows, so its fields become columns people can add to their own grid. It is one row of the list: an Object, a Join Mode and a Join Condition, which together read as a SQL join.
Adding a link¶
Press Link and choose the Object: the list holds the tables and views the Query Matrix knows on this ERP, and PULSE Dashboard's optimized tables. PULSE Dashboard then suggests a Join Condition from the keys the object and the report share, and says why on the status line. The suggestion comes, in order, from the report's own key when the object has every column of it, from a key of the object that the report has whole, or from the part of the object's key the report has, in which case the status line says rows may repeat. It never suggests a column that is not a key, and says so when the two share no key column.
Join Mode is LEFT JOIN or INNER JOIN. LEFT JOIN keeps every row of the report and fills in the object's columns where one matches; it is joined only when someone shows one of its fields. INNER JOIN keeps only the rows that have a match, so it is always joined.
The Join Condition is the ON of the join, in SQL. q is always the report's own rows; the object goes by its own name: arcusfil_sql.cus_no = q.cus_no. Comparisons, AND, OR, NOT, IN and constants all work, so oeordhdr_sql.ord_no = q.ord_no AND oeordhdr_sql.ord_type = 'O' is a valid condition. Links join in list order, and a Join Condition may name a link above it.
The cell has two buttons. The ellipsis opens the Join Condition in the SQL editor, with IntelliSense for q and every linked object. Wizard opens the Join Wizard: the object's key columns first, each matched to a report column, its other columns below, the SQL it writes shown live, and one sentence saying whether each report row matches at most one row of the object or may match several. The wizard reads back a condition that is only column matches; a condition with anything more it leaves to the SQL editor.
Remove takes out the selected link. View SQL Query... shows the whole FROM clause exactly as PULSE Dashboard runs it.
Check¶
Check counts the report's rows, then the rows with each link joined in turn, in the background with a Cancel, and writes the result on the status line:
- arcusfil_sql: one row for each row.
- #OPT_ARAging repeats rows: 35 rows become 196.
- oeordhdr_sql keeps 8 of 11 rows.
A check also runs on its own a moment after an edit, once every link is complete, so a repeat is known before the report is saved. Pressing Check while it runs cancels it. The result is kept on the link, so Release knows of a repeat without counting again.

When a link repeats rows¶
A LEFT JOIN gives a report row one row for each matching row of the object. That is correct for a list of customers joined to their invoices when the report adds up invoice amounts. It inflates the totals when a column added up by an Aggregate comes from before the link: each repeated row is counted again. Save keeps the report and shows the sentence; Release refuses only that case, and tells you to add to the Join Condition what makes one row match, or to make the optimized table the report's own data source.
Linking an optimized table¶
An optimized table is linked like any other object. Its fields are Query Matrix elements, so they arrive with PULSE Dashboard's captions, formats and aggregates. The table is built for each person from their own User Date and selections, and only when someone shows one of its fields; it is asked only for the fields in use. With an optimized table's row selected, the status line shows the table's description from the catalog, and adds Asking it for a field it does not hold yet rebuilds it for everyone using it when the table is shared.
What the links give users¶
Every plain field of a linked object appears in the report's column chooser, under the object's own Category, and in the Filter Editor. A linked field a user shows is grouped by as any key column is, and a click passes it to the drill-down.
Worked examples¶
An optimized table with a link. A buyer wants open purchase orders by vendor, with whatever vendor fields each buyer cares about. Choose Optimized table, type #OPT_ and pick the open purchase orders table. The report's columns are the table's; the preview shows its key columns. Link apvenfil_sql on the vendor number, arrange the preview, Save and Release. Each buyer then adds the vendor's terms, buyer code or phone number from the column chooser, and PULSE Dashboard builds those columns for that buyer alone.
Two links to one table. Customer order history combines open orders and invoices under one key, told apart by pulse_openrecord_fg. One link cannot serve both, so add two links to the same table, and write in the SQL editor what the wizard cannot: the first with AND q.pulse_openrecord_fg = 'Y', the second with AND q.pulse_openrecord_fg = 'N'. Check then reports each one's rows separately.
Need a hand?
The PULSE support team is happy to help: call (513) 723-8095 or email [email protected].