After you create a dimension table, you can write data to the dimension table for data analysis. You can also import data from a workbook, local CSV file, or local Excel file to the dimension table for data analysis. This topic describes how to import data to a dimension table.
Prerequisites
A dimension table is created. For more information, see Create a dimension table.Procedure
- In the All Dimension Tables section of the Dimension Table page, click the name of the desired dimension table in the File Name column.
- On the dimension table editing page, click Import in the upper-right corner.
- In the Import dialog box, select the type of the file that contains the data to be imported. Then, configure parameters in the Import dialog box. Note Only data of the STRING type can be imported to a dimension table. Data that is not of the STRING type is automatically converted to the data of the STRING type when the data is imported.
- Spreadsheet
Parameter Description Spreadsheet The workbook from which you want to import data. Select a workbook from the Spreadsheet drop-down list. Sheet The sheet from which you want to import data. Select a sheet from the Sheet drop-down list. Data Preview The data that you want to import. When you preview the data in the selected sheet, you can determine whether to use the values in the first row as the column names by selecting or clearing the First Row as Field Names check box. Field Mapping The mappings between the columns in the selected sheet and the fields in the dimension table. Import Data Mode The mode in which data is to be imported. Valid values: Append and Overlay. - Local CSV File
Parameter Description File The CSV file from which you want to import data. Click Select File(.csv), select a CSV file from your on-premises machine, and then click Open. Original Character Set The character set that is used by the selected CSV file. Valid values: UTF-8 and GBK. If garbled characters appear, you can change the character set. Separator The row delimiter and column delimiter. - The following row delimiters are supported: \r\n, \n, and \r.
- The following column delimiters are supported: commas (,), semicolons (;), and \t.
If the cell data cannot be correctly separated, you can change the delimiters.
Data Preview The data that you want to import. When you preview the data in the selected CSV file, you can determine whether to use the values in the first row as the column names by selecting or clearing the First Row as Field Names check box. Field Mapping The mappings between the columns in the selected CSV file and the fields in the dimension table. Import Data Mode The mode in which data is to be imported. Valid values: Append and Overlay. - Local Excel File
Parameter Description File The Excel file from which you want to import data. Click Select File(.xlsx), select an Excel file from your on-premises machine, and then click Open. Sheet The sheet from which you want to import data. Select a sheet from the Sheet drop-down list. Data Preview The data that you want to import. When you preview the data in the selected sheet, you can determine whether to use the values in the first row as the column names by selecting or clearing the First Row as Field Names check box. Field Mapping The mappings between the columns in the selected sheet and the fields in the dimension table. Import Data Mode The mode in which data is to be imported. Valid values: Append and Overlay.
- Spreadsheet
- Click OK.
- Click Save in the upper-right corner of the page. In the Diff From the Previous Version message, click Confirm Save. After you save the dimension table, you can use the version comparison feature to check whether the changes meet expectations to prevent accidental operations.