Funnel of Order Attrition¶
Known issues
Some chart features have known issues in the current release. See Known issues.
This walkthrough draws one centered band per order stage, answering "Where do orders drop out?"
Prerequisites¶
- Editor mode: click once on the screen, then press Ctrl+d. The AMIDB Shell Tool and the gallery are used as in the quickstart.
- Data: the example data that stage 1 creates. To use a table of your own instead, see With your own data.
1. Create the example data¶
The chart reads a table in the Center, so create the table first.
- Select Dashboard -> AMIDB Shell Tool....
-
Run:
-
Check that the lower pane shows the 5 rows.
The stages are numbered so that they stay in order over MCP too. In the gallery the template keeps the rows' order, but the MCP template sorts its categories alphabetically, and its "Order by:" does not change that; see Ordering bars by value.
2. Create the chart¶
The gallery creates a datamodel that reads the table, then places the chart.
- Select Windows -> New Window, then the edit button on
Blank1, then "Create Table / Visualization / Form". - Select "AMI (__AMI)", then "Next >>".
- Select the "USER" tile
ChartDemoOrderFlow, then "Next >>". - Select "Test (alt+enter)", then "Next >>".
- Select the "Flow" tab, then the "Funnel" tile.
-
Set the fields below the tiles:
Field Value "Stage:" Stage"Value:" Orders"Order by:" Ord -
Select "Finish".
- Check that the window shows 5 centered bands, labeled with their order counts.
3. Put the first stage on top¶
The first stage is drawn at the bottom.
- Open "Edit Axis" on the vertical axis.
- Select the "Ordering:" button once, so that it reads "Ascending".
- Check that "1 Received", 1,000, is now at the top and "5 Settled", 600, at the bottom.
Result¶
5 bands narrowing from 1,000 received to 600 settled, the largest drop, 250, between "3 Routed" and "4 Filled".
The chart's own PNG export, from AmiScript toImagePng; see Chart type walkthroughs.
To check without looking, read the render stats: session.getDevTools().getAllRenderStats() in the AMIDB Shell Tool, with "Run on this web session" selected (see Running a script), or web_debug op=panelRenderStats over MCP. The "Stages" layer reports Rows 5, "5 groups", and an empty Problem.
With your own data¶
The chart needs one row per stage: its name, its value, and a number that puts the stages in order. In stage 2, select the "USER" tile of your table in place of ChartDemoOrderFlow, and map your columns to the fields in stage 2's field table. Stage 2's check quotes the example data; on yours, check the same features against your own values. To filter rows, or to total raw rows first, see Using your own data.
Over MCP¶
An agent builds the same chart from the same table. Connecting an agent is covered in the AI section; the tools are on Building charts over MCP.
-
Create the datamodel with
web_executeop=importDatamodeland thisdmJson, then run it once withop=initDatamodelSchemaanddmNameChartDemoOrderFlow: -
Create the chart:
-
Run the datamodel again with
web_executeop=executeDatamodel,dmNameChartDemoOrderFlow. A chart created over MCP can stay empty until its datamodel runs again, with its axes at 0-100. - Confirm that every layer reports the rows above and an empty
Problem: runweb_debugop=panelRenderStats.
The call is web_create_chart_from_template. The first stage starts at the bottom here too.
Removing the example¶
Remove the chart, then its datamodel, then the table, so that the next walkthrough can reuse the names:
- Close the chart's window with its close button, and select "Delete" when asked whether to delete the panel.
- Select Dashboard -> Data Modeler..., expand "Datamodels", right-click the chart's datamodel,
ChartDemoOrderFlow, and select "Delete Datamodel", then "Yes". If that name was taken when stage 2 ran, the gallery added a number to it, as inChartDemoOrderFlow1. - Run
DROP TABLE ChartDemoOrderFlow;in the AMIDB Shell Tool. - Check that
SELECT * FROM ChartDemoOrderFlow;reportsUnknown table: ChartDemoOrderFlow.
Over MCP, delete the chart with web_danger op=deletePanel, then the datamodel with op=deleteDatamodel, dmName ChartDemoOrderFlow, and drop the table as in step 3. deleteDatamodel refuses a datamodel that has been committed; delete that one in the Data Modeler as in step 2. See Removing an agent's chart.
