Unit 3: Defining and Configuring Fact Tables¶
Based on the requirements of metrics, this unit defines and configures two fact tables of Solar_Generation_Fact_Table and Temperature_Radiation_Fact_Table, configure the data of device-level solar generation and the data of ambient temperature and horizontal radiance to fact tables, and associates with dimension tables. The relationship between fact tables and data tables are as follows.
Fact Table
Data Table
Solar_Generation_Fact_Table
solar_device_data.csv
Temperature_Radiation_Fact_Table
weather_sensor_data.xlsx
Step 1: Defining the Fact Table of Solar Generation¶
Select Fact Tables from the left navigation pane and go to the Fact table page.
Select New in the Fact Table Definition tab, go to the New Fact Table page, and enter the following information:
Basic Information
Fact Table ID: Enter
fact_solarpowerFact Table Name: Enter
Solar_Generation_Fact_TableFact Table Name: Select
Data Source RegistrationSelect Data Source
Data Source Type: Select
MySQLData Source Name: Select
tutorial_solar
Description: Enter
Generation of solar devices
Fact Table Logic Information
Associated Dimension
Attribute ID: Enter
source_keyDescription: Enter
Device IDData Type: Select
STRINGAssociated Dimension: Select
dim_solarplant.guid
Fact Attribute
Attribute ID: Enter
date_timeDescription: Enter
Time fieldData Type: Select
TIMESTAMP
Measurement
Measurement 1
Attribute ID: Enter
dc_powerDescription: Enter
DCData Type: Select
STRING
Measurement 2
Attribute ID: Enter
ac_powerDescription: Enter
ACData Type: Select
STRING
Measurement 3
Attribute ID: Enter
daily_yieldDescription: Enter
Daily generationData Type: Select
STRING
Measurement 4
Attribute ID: Enter
total_yieldDescription: Enter
GenerationData Type: Select
STRING
Select Publish to save and publish this fact table.
Step 2: Configuring the Fact Table of Solar Generation¶
Select the Fact Table Configuration tab, select New, and select the fact table ID of
fact_solarpower.Data Source Type:
Import from data tableTable Name:
solar_device_dataField Mappings
source_key select
SOURCE_KEYas the mapping fielddate_time select
DATE_TIMEas the mapping fielddc_power select
DC_POWERas the mapping fieldac_power select
AC_POWERas the mapping fielddaily_yield select
DAILY_YIELDas the mapping fieldtotal_yield select
TOTAL_YIELDas the mapping field
Select Next to preview the configuration.
Select Publish to finish the configuration of this fact table
Step 3: Defining the Fact Table of Temperature and Radiation¶
Select New in the Fact Table Definition tab, go to the New Fact Table page, and enter the following information:
Basic Information
Fact Table ID: Enter
fact_sensorFact Table Name: Enter
Temperature_Radiation_Fact_TableData Connection Type: Select
Data Source RegistrationSelect Data Source
Data Source Type: Select
MySQLData Source Name: Select
tutorial_solar
Description: Enter
Data of temperature and radiation
Fact Table Logic Information
Associated Dimension
Attribute ID: Enter
source_keyDescription: Enter
Sensor IDData Type: Select
STRINGAssociated Dimension: Select
dim_sensor.guid
Fact Attribute
Attribute ID: Enter
date_timeDescription: Enter
Time fieldData Type: Select
TIMESTAMP
Measurement
Measurement 1
Attribute ID: Enter
ambient_temperatureDescription: Enter
Ambient temperatureData Type: Select
STRING
Measurement 2
Attribute ID: Enter
module_temperatureDescription: Enter
Module temperatureData Type: Select
STRING
Measurement 3
Attribute ID: Enter
irradiationDescription: Enter
RadiationData Type: Select
STRING
Select Publish to save and publish this fact table.
Step 4: Configuring the Fact Table of Temperature and Radiation¶
Select the Fact Table Configuration tab, select New, and select the fact table ID of
fact_sensor.Data Source Type: Select
Import from data tableTable Name: Select
weather_sensor_dataField Mappings
source_key select
SOURCE_KEYas the mapping fielddate_time select
DATE_TIMEas the mapping fieldambient_temperature select
AMBIENT_TEMPERATUREas the mapping fieldmodule_temperature select
MODULE_TEMPERATUREas the mapping fieldirradiation select
IRRADIATIONas the mapping field
Select Next to preview the configuration.
Select Publish to finish the configuration of this fact table