show

show, keyword

Displays a dashboard tile. Every script must emit at least one tile.

Syntax overview

The general shape of a show statement is:

show table "my title" a1c2 slices: SX { tileColor: tomato; backgroundColor: "#fdad31" } with
  Items.Category as "My category"
  Items.Supplier as "My supplier"
  sum(Items.StockOnHand) as "Stock on hand"
  sum(Items.StockOnHand * Items.BuyPrice) as "Stock value"
  group by [Items.Category, Items.Supplier]
  order by [Items.Category, sum(Items.StockOnHand * Items.BuyPrice)] desc

The elements that compose a tile are:

Grouping and ordering

The expressions passed after with are aligned into a table for the tile. You can add group by and order by statements at the end of that list:

show table "my table" with
  T.X
  T.Y
  T.Z
  order by [T.X desc, T.Y]

Envision also offers a concise inline form for simple tiles:

show table "my table" with T.X, T.Y, T.Z

Example

table Sales = with
  [| as Region, as Units |]
  [| "Europe", 100 |]
  [| "Europe", 125 |]
  [| "North America", 1000 |]
  [| "North America", 75 |]

show label "Sales demo"
show scalar "Total units" with sum(Sales.Units)

show table "Units by region" with
  Sales.Region
  sum(Sales.Units) as "Units"
  group by Sales.Region

show barchart "Units by region" with
  sum(Sales.Units) as "Units"
  group by Sales.Region

The show table tile renders:

Region Units
Europe 225
North America 1075

Remarks

The tile type (such as scalar or table) controls how vectors are rendered. The tile title must be a scalar text value and can be computed. The with block is required for all tile types except label.

See also

Below is the complete list of tile types supported by Envision:

User Contributed Notes
0 notes + add a note