当前位置:网站首页>Restcloud ETL practice data row column conversion
Restcloud ETL practice data row column conversion
2022-07-01 02:42:00 【RestCloud】

RestCloud ETL Community Edition is a data integration tool , Provide visual multi data pipeline construction 、 Data source management 、 Operation monitoring and authority management functions .
This article will simplify the table data in the figure below by converting multiple rows to multiple columns .

Simplify your thinking : Turn the grades of different subjects in the same name into column names , Convert three rows of data in the database into one row of data for display .
The first is process design

Three components are used here , They are library table input 、 Convert multiple rows to multiple columns 、 Library table output , Library table input obtains table data , Then the data structure is redistributed from multiple rows to multiple columns , Then output the data into a new database table through the database table output .
Component configuration
1. Library table input

This is mainly used to obtain data , You only need to configure the data source and database tables , Make sure you can input data , Others are generated automatically .
2. Multi row to multi column

In the node where the data is located, select the node where the source data is located , Get the data that needs to be converted .
Select the field to be grouped in the grouping field , For example, according to the above database , There are three subjects under the same name , Then you can select XM This field .
Key fields id Here is the field to be selected to convert the value into a column .

Here, according to the key fields selected in the basic attributes id, Get key fields id In the value of the , Then according to this value, get the corresponding data in the data field and put it into the corresponding new target field .
3. Library table output

Here, select the output data source , And the name of the watch .

In field configuration, you need to configure the output fields and the new target fields after conversion , Remove unnecessary fields . If it has become a column name as a condition KCMC Fields and values have been assigned to the new field CJ Field .

Don't forget when exporting , If it is a new table, you need to select auto create table .
Run the process after configuration .

In the log, you can see the prompt that the table was successfully created and the data was successfully inserted .
Data has also been successfully written to the database .


Thank you for your attention and support ! For more features , Please join RestCloud ETL Community free download experience , Download address :https://etl.restcloud.cn
边栏推荐
猜你喜欢

PCB defect detection based on OpenCV and image subtraction

VirtualBox installation enhancements

pycharm 软件deployment 灰色 无法点

旷世轻量化网络ShuffulNetV2学习笔记

How to use Jieba participle in unity

Dell服务器重启iDRAC方法

Leetcode interview question 17.10 Main elements

Densenet network paper learning notes

PMP是什麼?

Ernie gram, an explicit and complete n-gram mask language model, implements explicit n-gram semantic unit knowledge modeling.
随机推荐
Restcloud ETl数据通过时间戳实现增量数据同步
如何在智汀中实现智能锁与灯、智能窗帘电机场景联动?
Mouse over effect II
SWT / anr problem - SWT caused by too long dump time
Youmeng (a good helper for real-time monitoring of software exceptions: crash) access tutorial (the easiest tutorial for Xiaobai with some foundation)
SWT / anr problem - SWT caused by long execution time of native method
ANR问题的分析与解决思路
如果我在北京,到哪里开户比较好?另外,手机开户安全么?
Ernie gram, an explicit and complete n-gram mask language model, implements explicit n-gram semantic unit knowledge modeling.
Qu'est - ce que le PMP?
Proxy support and SNI routing of pulsar
[PR # 5 A] two way running (state pressure DP)
[multi source BFS] 934 Shortest Bridge
联想X86服务器重启管理控制器(XClarity Controller)或TSM的方法
Mouse over effect 8
Densenet network paper learning notes
Xception学习笔记
Leetcode (524) -- match the longest word in the dictionary by deleting letters
零基础自学SQL课程 | 窗口函数
Rocketqa: cross batch negatives, de noised hard negative sampling and data augmentation