Skip to content

Config DataSet

yzhang921 edited this page Dec 20, 2016 · 1 revision

DataSet is similar to the cube of OLAP analysis. You can define the query and calculated measures in advance. It's very useful when data model is relatively stable. Using dataset can avoid repeated input query scripts, create new aggregate expressions, and improve the efficiency of Dashboard loading(Dataset cached by id).
The difference of CBoard dataset against cube of other product is the light model feature. Any simple query result set can be used as a cube. Cube update is simple and directly needn't conventional model tedious update steps(modification, release, test). For example, for the first business requirement needs you choose columns a, b, c, d four columns as dimensions of the a Cube, query as blow:

SELECT a, b, c, 
       sum(xx) AS m1, count(yyy) AS m2
  FROM fact a
  JOIN dima a ON ...
  JOIN dimb b ON ...
 GROUP BY a, b, c

After a new demand, you need to introduce the new dimension columns: e, f, g. Under CBoard light model concept you just need to simply modify the query or copy as a new query then update script as below:

SELECT a, b, c, e, f, g
       sum(xx) AS m1, count(yyy) AS m2
  FROM fact a
  JOIN dima a ON ...
  JOIN dimb b ON ...
 GROUP BY a, b, c, e, f, g

Before version 0.2, all the result set will be load into your explorer for quick olap operation. For performance reason, please push down the aggregation operation to your data source engine manually by control your query scripts. We'll try to do some experience to add aggregate feature to specifically DataProvider.

DateSet

  1. Config -> DataSet -> New -> Choose one DataSource
  2. Input Category/Name, SQL Text
  3. Load Data
  4. Once load data successed, Calculated Measures line show out, click button Add to define a measure
  5. Input correct Expression Text. For example: Math.log(sum(columnA)/count(columB)). Check button can only detect the expression format is basically correct, complex expression can not be guaranteed the success of 100% after the success of the check status. image
  6. Real-time refresh interval can be kept empty if don't need refresh data automatic, fill in a value greater than 0 to refresh the dataset interval
  7. Save

image