Page tree
Skip to end of metadata
Go to start of metadata

Prerequisites

  • Have you completed the Getting Started with Play SQL?
  • Is Play SQL active? Go to the "?" menu, click Play SQL. The About page displays a warning if Play SQL is inactive.

 

Once you create a spreadsheet, you can enter data from a regular Confluence page. Once you have a spreadsheet, you can use a Query to display custom results, such as a subset of the spreadsheet or a computation of statistics:

Create a spreadsheet

Go to a Space, then click on the "Tables" link in the sidebar:

Click on Create Spreadsheet on the top left and enter a name:

Click the + button to create a new column:

Type enter to finish the column creation. Customize your table and click on a column header to change the type:

Several types are available:

  • String, Icon, Link for text fields,
  • Integer, Decimal, Currency for number fields,
  • True/False, Date

See the full list of types and renderers.

Insert the Spreadsheet on a page

Edit a page, type {

Select the spreadsheet:

Done! Your spreadsheet is available to users:

Write your first query

Edit a page, type {

Click Create a new query, then immediately click "Edit Query":

The query editor appears. Type the following query:

SELECT winner "Winner", MAX(points_winner - points_loser) "Max difference"
FROM scoresheet
GROUP BY winner
ORDER BY MAX(points_winner - points_loser) DESC

 

Click Save, then return to your page:

(tick) Done: You're a SQL addict now.

Make a graph

Edit a page, insert the Chart macro:

Create a Play SQL Query macro inside the Charts one, as follows:

Edit the Charts macro, find the field "Columns" (write "Winner, Max difference") and Content Orientation (horizontal is surely the right one).

View the page:

(tick) Done, you're a pro reporter, get cracking now.

 

  • No labels