当前位置:网站首页>Restcloud ETL实践之数据行列转换
Restcloud ETL实践之数据行列转换
2022-07-01 02:22:00 【RestCloud】

RestCloud ETL社区版是一款数据集成工具,提供可视化多数据管道构建、数据源管理、运行监控及权限管理功能。
本篇将使用多行转多列的方式把下方图中的表数据进行简化。

简化思路:把相同姓名中不同的学科成绩转成列名,将数据库中三行数据转变成一行数据显示。
首先是流程设计

这里使用了三个组件,分别是库表输入、多行转换为多列、库表输出,库表输入获取表数据,再由多行转多列将数据结构重新分配,再借由库表输出将数据输出成一个新的数据库表。
组件配置
1.库表输入

这里主要是用于获取数据,只需要配置数据源以及数据库表,确保能够输入数据即可,其它采用自动生成的就行了。
2.多行转多列

在数据所在的节点中选中源数据所在的节点,获取需要进行转换的数据。
分组字段中选中要进行分组的字段,比如根据上面的数据库,同一名字下有三个学科的成绩,那就可以选中XM这个字段。
关键字段id这里就是要选择将值转为列的字段。

这里根据基本属性中选中的关键字段id,获取关键字段id里的值,再根据这个值去获取数据字段里对应的数据放到对应的新的目标字段中。
3.库表输出

这里选择输出的数据源,以及表名。

字段配置中需要配置输出的字段以及转换后的新的目标字段,去掉不需要的字段。如已经作为条件变成了列名的KCMC字段和值已经赋给了新字段的CJ字段。

输出时不要忘记,若是新表则需要选择自动创建表。
完成配置后运行流程。

在日志中可以看见提示了创建表成功以及成功插入了数据。
数据库中也成功写入了数据。


感谢您对我们的关注和支持!如需了解更多的功能,请加入RestCloud ETL社区免费下载体验,下载地址:https://etl.restcloud.cn
边栏推荐
- Winodws 快速添加开机启动项
- SWT/ANR问题--StorageManagerService卡住
- Rocketqa: cross batch negatives, de noised hard negative sampling and data augmentation
- Pytorch —— 基礎指北_貳 高中生都能看懂的[反向傳播和梯度下降]
- Find the length of the common part of two line segments
- 计算特殊奖金
- AI 边缘计算平台 - BeagleBone AI 64 简介
- 最新微信ipad协议 CODE获取 公众号授权等
- (翻译)实时内联验证更容易让用户犯错的原因
- The image variables in the Halcon variable window are not displayed, and it is useless to restart the software and the computer
猜你喜欢

如何在智汀中實現智能鎖與燈、智能窗簾電機場景聯動?

CorelDRAW 2022中文精简64位直装版下载

What is project management?

@ConfigurationProperties和@Value的区别

SWT / anr problem - binder stuck

What are the applications of SMS in enterprises?

Image preloading in JS

FL studio20.9 fruit software advanced Chinese edition electronic music arrangement

My PMP learning test experience

UE4渲染管线学习笔记
随机推荐
int和位数组互转
I want to know how to open a stock account? Is it safe to open an account online?
Template: globally balanced binary tree
Windows quick add boot entry
[multi source BFS] 934 Shortest Bridge
House change for agricultural products? "Disguised" house purchase subsidy!
先写API文档还是先写代码?
URL和URI
Zero foundation self-study SQL course | window function
静态域与静态方法
SAP ALV汇总跟导出Excel 汇总数据不一致
FL studio20.9 fruit software advanced Chinese edition electronic music arrangement
7_ Openresty installation
How do I open an account on my mobile phone? Also, is it safe to open an account online?
URLs and URIs
PMP是什麼?
SWT/ANR问题--Native方法执行时间过长导致SWT
How to realize the scene linkage of intelligent lock, lamp and intelligent curtain motor in zhiting?
【2022年】江西省研究生数学建模方案、代码
When facing the industrial Internet, they even use the ways and methods of consuming the Internet to land and practice the industrial Internet