Superlists are lists that allow to put graphics into the table's rows
 

1 SQL Statement

The first step is to setup the query.

The aim of this superlist is to show three graphics where the data displayed corresponds to one year sales, costs and unit sales. For this is needed to create the appropiate columns for the corresponding months and data. See the sentence used below.

Copy
<select>
        <columns>
            store_city,
            (SELECT SUM(store_sales) FROM sales_fact_1998 INNER JOIN time_by_day ON time_by_day.time_id=sales_fact_1998.time_id 
            WHERE sales_fact_1998.store_id=store.store_id AND time_by_day.month_of_year = "1") <alias name='sales_jan'/>,
            (SELECT SUM(store_sales) FROM sales_fact_1998 INNER JOIN time_by_day ON time_by_day.time_id=sales_fact_1998.time_id 
            WHERE sales_fact_1998.store_id=store.store_id AND time_by_day.month_of_year = "2") <alias name='sales_feb'/>,
            (SELECT SUM(store_sales) FROM sales_fact_1998 INNER JOIN time_by_day ON time_by_day.time_id=sales_fact_1998.time_id 
            WHERE sales_fact_1998.store_id=store.store_id AND time_by_day.month_of_year = "3") <alias name='sales_mar'/>,
            (SELECT SUM(store_sales) FROM sales_fact_1998 INNER JOIN time_by_day ON time_by_day.time_id=sales_fact_1998.time_id 
            WHERE sales_fact_1998.store_id=store.store_id AND time_by_day.month_of_year = "4") <alias name='sales_apr'/>,
            (SELECT SUM(store_sales) FROM sales_fact_1998 INNER JOIN time_by_day ON time_by_day.time_id=sales_fact_1998.time_id 
            WHERE sales_fact_1998.store_id=store.store_id AND time_by_day.month_of_year = "5") <alias name='sales_may'/>,
            (SELECT SUM(store_sales) FROM sales_fact_1998 INNER JOIN time_by_day ON time_by_day.time_id=sales_fact_1998.time_id 
            WHERE sales_fact_1998.store_id=store.store_id AND time_by_day.month_of_year = "6") <alias name='sales_jun'/>,
            (SELECT SUM(store_sales) FROM sales_fact_1998 INNER JOIN time_by_day ON time_by_day.time_id=sales_fact_1998.time_id 
            WHERE sales_fact_1998.store_id=store.store_id AND time_by_day.month_of_year = "7") <alias name='sales_jul'/>,
            (SELECT SUM(store_sales) FROM sales_fact_1998 INNER JOIN time_by_day ON time_by_day.time_id=sales_fact_1998.time_id 
            WHERE sales_fact_1998.store_id=store.store_id AND time_by_day.month_of_year = "8") <alias name='sales_aug'/>,
            (SELECT SUM(store_sales) FROM sales_fact_1998 INNER JOIN time_by_day ON time_by_day.time_id=sales_fact_1998.time_id 
            WHERE sales_fact_1998.store_id=store.store_id AND time_by_day.month_of_year = "9") <alias name='sales_sep'/>,
            (SELECT SUM(store_sales) FROM sales_fact_1998 INNER JOIN time_by_day ON time_by_day.time_id=sales_fact_1998.time_id 
            WHERE sales_fact_1998.store_id=store.store_id AND time_by_day.month_of_year = "10") <alias name='sales_oct'/>,
            (SELECT SUM(store_sales) FROM sales_fact_1998 INNER JOIN time_by_day ON time_by_day.time_id=sales_fact_1998.time_id 
            WHERE sales_fact_1998.store_id=store.store_id AND time_by_day.month_of_year = "11") <alias name='sales_nov'/>,
            
            (SELECT SUM(store_cost) FROM sales_fact_1998 INNER JOIN time_by_day ON time_by_day.time_id=sales_fact_1998.time_id 
            WHERE sales_fact_1998.store_id=store.store_id AND time_by_day.month_of_year = "1") <alias name='cost_jan'/>,
            (SELECT SUM(store_cost) FROM sales_fact_1998 INNER JOIN time_by_day ON time_by_day.time_id=sales_fact_1998.time_id 
            WHERE sales_fact_1998.store_id=store.store_id AND time_by_day.month_of_year = "2") <alias name='cost_feb'/>,
            (SELECT SUM(store_cost) FROM sales_fact_1998 INNER JOIN time_by_day ON time_by_day.time_id=sales_fact_1998.time_id 
            WHERE sales_fact_1998.store_id=store.store_id AND time_by_day.month_of_year = "3") <alias name='cost_mar'/>,
            (SELECT SUM(store_cost) FROM sales_fact_1998 INNER JOIN time_by_day ON time_by_day.time_id=sales_fact_1998.time_id 
            WHERE sales_fact_1998.store_id=store.store_id AND time_by_day.month_of_year = "4") <alias name='cost_apr'/>,
            (SELECT SUM(store_cost) FROM sales_fact_1998 INNER JOIN time_by_day ON time_by_day.time_id=sales_fact_1998.time_id 
            WHERE sales_fact_1998.store_id=store.store_id AND time_by_day.month_of_year = "5") <alias name='cost_may'/>,
            (SELECT SUM(store_cost) FROM sales_fact_1998 INNER JOIN time_by_day ON time_by_day.time_id=sales_fact_1998.time_id 
            WHERE sales_fact_1998.store_id=store.store_id AND time_by_day.month_of_year = "6") <alias name='cost_jun'/>,
            (SELECT SUM(store_cost) FROM sales_fact_1998 INNER JOIN time_by_day ON time_by_day.time_id=sales_fact_1998.time_id 
            WHERE sales_fact_1998.store_id=store.store_id AND time_by_day.month_of_year = "7") <alias name='cost_jul'/>,
            (SELECT SUM(store_cost) FROM sales_fact_1998 INNER JOIN time_by_day ON time_by_day.time_id=sales_fact_1998.time_id 
            WHERE sales_fact_1998.store_id=store.store_id AND time_by_day.month_of_year = "8") <alias name='cost_aug'/>,
            (SELECT SUM(store_cost) FROM sales_fact_1998 INNER JOIN time_by_day ON time_by_day.time_id=sales_fact_1998.time_id 
            WHERE sales_fact_1998.store_id=store.store_id AND time_by_day.month_of_year = "9") <alias name='cost_sep'/>,
            (SELECT SUM(store_cost) FROM sales_fact_1998 INNER JOIN time_by_day ON time_by_day.time_id=sales_fact_1998.time_id 
            WHERE sales_fact_1998.store_id=store.store_id AND time_by_day.month_of_year = "10") <alias name='cost_oct'/>,
            (SELECT SUM(store_cost) FROM sales_fact_1998 INNER JOIN time_by_day ON time_by_day.time_id=sales_fact_1998.time_id 
            WHERE sales_fact_1998.store_id=store.store_id AND time_by_day.month_of_year = "11") <alias name='cost_nov'/>,
            
            (SELECT SUM(unit_sales) FROM sales_fact_1998 INNER JOIN time_by_day ON time_by_day.time_id=sales_fact_1998.time_id 
            WHERE sales_fact_1998.store_id=store.store_id AND time_by_day.month_of_year = "1") <alias name='units_jan'/>,
            (SELECT SUM(unit_sales) FROM sales_fact_1998 INNER JOIN time_by_day ON time_by_day.time_id=sales_fact_1998.time_id 
            WHERE sales_fact_1998.store_id=store.store_id AND time_by_day.month_of_year = "2") <alias name='units_feb'/>,
            (SELECT SUM(unit_sales) FROM sales_fact_1998 INNER JOIN time_by_day ON time_by_day.time_id=sales_fact_1998.time_id 
            WHERE sales_fact_1998.store_id=store.store_id AND time_by_day.month_of_year = "3") <alias name='units_mar'/>,
            (SELECT SUM(unit_sales) FROM sales_fact_1998 INNER JOIN time_by_day ON time_by_day.time_id=sales_fact_1998.time_id 
            WHERE sales_fact_1998.store_id=store.store_id AND time_by_day.month_of_year = "4") <alias name='units_apr'/>,
            (SELECT SUM(unit_sales) FROM sales_fact_1998 INNER JOIN time_by_day ON time_by_day.time_id=sales_fact_1998.time_id 
            WHERE sales_fact_1998.store_id=store.store_id AND time_by_day.month_of_year = "5") <alias name='units_may'/>,
            (SELECT SUM(unit_sales) FROM sales_fact_1998 INNER JOIN time_by_day ON time_by_day.time_id=sales_fact_1998.time_id 
            WHERE sales_fact_1998.store_id=store.store_id AND time_by_day.month_of_year = "6") <alias name='units_jun'/>,
            (SELECT SUM(unit_sales) FROM sales_fact_1998 INNER JOIN time_by_day ON time_by_day.time_id=sales_fact_1998.time_id 
            WHERE sales_fact_1998.store_id=store.store_id AND time_by_day.month_of_year = "7") <alias name='units_jul'/>,
            (SELECT SUM(unit_sales) FROM sales_fact_1998 INNER JOIN time_by_day ON time_by_day.time_id=sales_fact_1998.time_id 
            WHERE sales_fact_1998.store_id=store.store_id AND time_by_day.month_of_year = "8") <alias name='units_aug'/>,
            (SELECT SUM(unit_sales) FROM sales_fact_1998 INNER JOIN time_by_day ON time_by_day.time_id=sales_fact_1998.time_id 
            WHERE sales_fact_1998.store_id=store.store_id AND time_by_day.month_of_year = "9") <alias name='units_sep'/>,
            (SELECT SUM(unit_sales) FROM sales_fact_1998 INNER JOIN time_by_day ON time_by_day.time_id=sales_fact_1998.time_id 
            WHERE sales_fact_1998.store_id=store.store_id AND time_by_day.month_of_year = "10") <alias name='units_oct'/>,
            (SELECT SUM(unit_sales) FROM sales_fact_1998 INNER JOIN time_by_day ON time_by_day.time_id=sales_fact_1998.time_id 
            WHERE sales_fact_1998.store_id=store.store_id AND time_by_day.month_of_year = "11") <alias name='units_nov'/>, 
            
            SUM(store_sales)  <alias name='store_sales'/>,
            SUM(store_cost)   <alias name='store_cost'/>,
            SUM(unit_sales)   <alias name='unit_sales'/>
        </columns>
        <from table='sales_fact_1998'>
            <join table='time_by_day'>
                <on>sales_fact_1998.time_id=time_by_day.time_id</on>
            </join>
            <join table='store'>
                <on>store.store_id = sales_fact_1998.store_id</on>
            </join>
        </from>
        <group>1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34</group>
        <order>1</order>
    </select>

There are also going to be displayed some values as in a plane list.

 

2 Columns headers

In this case it is important to define the column headers, those are going to group the data. To display this data as a graphic, the user must select the Render of this column header as it is shown in the picture.

 

3 Output Fields

In the output field the user has to add all the columns. Those have to be defined with the corresponding Header and its appropiate Render

 

4 Result

IMPORTANT NOTE

It must take into consideration that superlist depending on query, only supports cartesian graphs, wherefore some types of graphics will not be as desired.This is the case of Pies charts, Funnels, Gauges or Radars.