kettle--组件(2)--计算器
组件如下:

对计算类型的说明如下:
The table below contains descriptions associated with the calculator step:
| Function | Description | Required fields |
|---|---|---|
| Set field to constant A | Create a field with a constant value. | A |
| Create a copy of field A | Create a copy of a field with the given field value. | A |
| A + B | A plus B. | A and B |
| A - B | A minus B. | A and B |
| A * B | A multiplied by B. | A and B |
| A / B | A divided by B. | A and B |
| A * A | The square of A. | A |
| SQRT( A ) | The square root of A. | A |
| 100 * A / B | Percentage of A in B. | A and B |
| A - ( A * B / 100 ) | Subtract B% of A. | A and B |
| A + ( A * B / 100 ) | Add B% to A. | A and B |
| A + B *C | Add A and B times C. | A, B and C |
| SQRT( A*A + B*B ) | Calculate ?(A2+B2). | A and B |
| ROUND( A ) | Returns the closest Integer to the argument. The result is rounded to an Integer by adding 1/2, taking the floor of the result, and casting the result to type int. In other words, the result is equal to the value of the expression: floor (a + 0.5). In case you need the rounding method "Round half to even", use the following method ROUND( A, B ) with no decimals (B=0). |
A |
| ROUND( A, B ) | Round A to the nearest even number with B decimals. The used rounding method is "Round half to even", it is also called unbiased rounding, convergent rounding, statistician's rounding, Dutch rounding, Gaussian rounding, odd-even rounding, bankers' rounding or broken rounding, and is widely used in bookkeeping. This is the default rounding mode used in IEEE 754 computing functions and operators. In Germany it is often called "Mathematisches Runden". |
A and B |
| STDROUND( A ) | Round A to the nearest integer. The used rounding method is "Round half away from zero", it is also called standard or common rounding. In Germany it is known as "kaufmännische Rundung" (and defined in DIN 1333). |
A |
| STDROUND( A, B ) | Same rounding method used as in STDROUND (A) but with B decimals. |
A and B |
| CEIL( A ) | The ceiling function map a number to the smallest following integer. |
A |
| FLOOR( A ) | The floor function map a number to the largest previous integer. |
A |
| NVL( A, B ) | If A is not NULL, return A, else B. Note that sometimes your variable won't be null but an empty string. |
A and B |
| Date A + B days | Add B days to Date field A. | A and B |
| Year of date A | Calculate the year of date A. | A |
| Month of date A | Calculate number the month of date A. | A |
| Day of year of date | A Calculate the day of year (1-365). | A |
| Day of month of date A | Calculate the day of month (1-31). | A |
| Day of week of date A | Calculate the day of week (1-7). | A |
| Week of year of date A | Calculate the week of year (1-54). | A |
| ISO8601 Week of year of date A | Calculate the week of the year ISO8601 style (1-53). | A |
| ISO8601 Year of date A | Calculate the year ISO8601 style. | A |
| Byte to hex encode of string A | Encode bytes in a string to a hexadecimal representation. | A |
| Hex encode of string A | Encode a string in its own hexadecimal representation. | A |
| Char to hex encode of string A | Encode characters in a string to a hexadecimal representation. |
A |
| Hex decode of string A | Decode a string from its hexadecimal representation (add a leading 0 when A is of odd length). |
A |
| Checksum of a file A using CRC-32 | Calculate the checksum of a file using CRC-32. | A |
| Checksum of a file A using Adler-32 | Calculate the checksum of a file using Adler-32. | A |
| Checksum of a file A using MD5 | Calculate the checksum of a file using MD5. | A |
| Checksum of a file A using SHA-1 | Calculate the checksum of a file using SHA-1. | A |
| Levenshtein Distance (Source A and Target B) | Calculates the Levenshtein Distance: http://en.wikipedia.org/wiki/Levenshtein_distance | A and B |
| Metaphone of A (Phonetics) | Calculates the metaphone of A: http://en.wikipedia.org/wiki/Metaphone | A |
| Double metaphone of A | Calculates the double metaphone of A: http://en.wikipedia.org/wiki/Double_Metaphone | A |
| Absolute value ABS(A) | Calculates the Absolute value of A. | A |
| Remove time from a date A | Removes time value of A. | A |
| Date A - Date B (in days) | Calculates difference, in days, between A date field and B date field. |
A and B |
| A + B + C | A plus B plus C. | A, B, and C |
| First letter of each word of a string A in capital | Transforms the first letter of each word within a string. | A |
| UpperCase of a string A | Transforms a string to uppercase. | A |
| LowerCase of a string A | Transforms a string to lowercase. | A |
| Mask XML content from string A | Escape XML content; replace characters with &values. | A |
| Protect (CDATA) XML content from string A | Indicates an XML string is general character data, rather than non-character data or character data with a more specific, limited structure. The given string will be enclosed into <![CDATA[String]]>. |
A |
| Remove CR from a string A | Removes carriage returns from a string. | A |
| Remove LF from a string A | Removes linefeeds from a string. | A |
| Remove CRLF from a string A | Removes carriage returns/linefeeds from a string. | A |
| Remove TAB from a string A | Removes tab characters from a string. | A |
| Return only digits from string A | Outputs only Outputs only digits (0-9) from a string from a string. |
A |
| Remove digits from string A | Removes all digits (0-9) from a string. | A |
| Return the length of a string A | Returns the length of the string. | A |
| Load file content in binary | Loads the content of the given file (in field A) to a binary data type (e.g. pictures). |
A |
| Add time B to date A | Add the time to a date, returns date and time as one value. |
A and B |
| Quarter of date A | Returns the quarter (1 to 4) of the date. | A |
| variable substitution in string A | Substitute variables within a string. | A |
| Unescape XML content | Unescape XML content from the string. | A |
| Escape HTML content | Escape HTML within the string. | A |
| Unescape HTML content | Unescape HTML within the string. | A |
| Escape SQL content | Escapes the characters in a String to be suitable to pass to an SQL query. |
A |
| Date A - Date B (working days) | Calculates the difference between Date field A and Date field B (only working days Mon-Fri). |
A and B |
| Date A + B Months | Add B months to Date field A. | A |
| Check if an XML file A is well formed | Validates XML file input. | A |
| Check if an XML string A is well formed | Validates XML string input. | A |
| Get encoding of file A | Guess the best encoding (UTF-8) for the given file. | A |
| Dameraulevenshtein distance between String A and String B | Calculates Dameraulevenshtein distance between strings: http://en.wikipedia.org/wiki/Damerau%E2%80%93Levenshtein_distance |
A and B |
| NeedlemanWunsch distance between String A and String B | Calculates NeedlemanWunsch distance between strings: http://en.wikipedia.org/wiki/Needleman%E2%80%93Wunsch_algorithm | A and B |
| Jaro similitude between String A and String B | Returns the Jaro similarity coefficient between two strings. |
A and B |
| JaroWinkler similitude between String A and String B | Returns the Jaro similarity coefficient between two string: http://en.wikipedia.org/wiki/Jaro%E2%80%93Winkler_distance |
A and B |
| SoundEx of String A | Encodes a string into a Soundex value. | A |
| RefinedSoundEx of String A | Retrieves the Refined Soundex code for a given string object |
A |
| Date A + B Hours | Add B hours to Date field A | A and B |
| Date A + B Minutes | Add B minutes to Date field A | A and B |
| Date A - Date B (milliseconds) | Subtract B milliseconds from Date field A | A and B |
| Date A - Date B (seconds) | Subtract B seconds from Date field A | A and B |
| Date A - Date B (minutes) | Subtract B minutes from Date field A | A and B |
| Date A - Date B (hours) | Subtract B hours from Date field A | A and B |
| Hour of Day of Date A | Extract the hour part of the given date | A |
| Minute of Hour of Date A | Extract the minute part of the given date | A |
| Second of Hour of Date A | Extract the second part of a given date | A |
kettle--组件(2)--计算器的更多相关文章
- 利用kettle组件导入excel文件到数据库
利用kettle组件导入excel文件到数据库 1. 实现目标 把excel文件内容导入到目标表中:然后用java调用kettle的转换.excel文件的内容仅仅有两列,示比例如以下: wat ...
- 大量数据快速导出的解决方案-Kettle
1.开发背景 在web项目中,经常会需要查询数据导出excel,以前比较常见的就是用poi.使用poi的时候也有两种方式,一种就是直接将集合一次性导出为excel,还有一种是分批次追加的方式适合数据量 ...
- kettle将Excel数据导入oracle
导读 Excel数据导入Oracle数据库的方法: 1.使用PL SQL 工具附带的功能,效率比较低 可参考这篇文章的介绍:http://www.2cto.com/database/201212/17 ...
- kettle之mongodb数据同步
需求: 1.源数据库新增一条记录,目标库同时新增一条记录: 2.源数据库修改一条记录,目标库同时修改该条记录: 示例用到三个Kettle组件 下面详细说下每个组件的配置 Source: 本示例连接的是 ...
- Kettle之数据抽取、转换、装载
Kettle 官网 ETL利器Kettle实战应用解析系列 利用kettle组件导入excel文件到数据库 kettle中实现动态SQL查询 java中调用kettle转换文件
- kettle的系列教程
kettle--window开发环境和linux运行环境的迁移 kettle的输入输出组件和脚本组件 kettle--变量的使用 kettle的资源库 kettle的job kettle的hello ...
- 01.Java 开发简单的计算器
难度为一般,适合具有 Java 基础和 Swing 组件编程知识的用户学习一. 实验介绍1.1 实验内容本次实验利用Java开发一个可以进行简单的四则运算的图形化计算器,会使用到 Java Swing ...
- 使用Kettle导出excel
1.开发背景 在web项目中,经常会需要查询数据导出excel,以前比较常见的就是用poi.使用poi的时候也有两种方式,一种就是直接将集合一次性导出为excel,还有一种是分批次追加的方式适合数据量 ...
- Pentaho BIServer Community Edtion 6.1 使用教程 第三篇 发布和调度Kettle(Data Integration) 脚本 Job & Trans
Pentaho BIServer Community Edtion 6.1 集成了 Kettle 组件,可以运行Kettle 程序脚本.但由于Kettle没有直接发布到 BIServer-ce 服务的 ...
- Kettle-6.1安装部署及使用教程
一.Kettle概念 Kettle是一款国外开源的ETL工具,纯java编写,可以在Window.Linux.Unix上运行,绿色无需安装,数据抽取高效稳定. Kettle 中文名称叫水壶,该项目的主 ...
随机推荐
- 【BFS】Pots
[poj3414]Pots Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 16925 Accepted: 7168 ...
- 【推导】Codeforces Round #364 (Div. 2) D. As Fast As Possible
一种方法是二分总时间,复杂度O(nlogn). 另外我们可以证明,当所有人同时到达终点的时候,是最优的,因为没有人的时间“浪费”了. 我们又发现,每个人的运动过程总是两段,要么是走路,要么是坐车.于是 ...
- 【最小乘积生成树】bzoj2395[Balkan 2011]Timeismoney
设每个点有x,y两个权值,求一棵生成树,使得sigma(x[i])*sigma(y[i])最小. 设每棵生成树为坐标系上的一个点,sigma(x[i])为横坐标,sigma(y[i])为纵坐标.则问题 ...
- [TC14860]SquadConstructor2
[TC14860]SquadConstructor2 题目大意: 有\(n(n<2^m,m\le8)\)个互不相等的数\(v_i\).从中选取\(k(k\le8)\)个数\(b_i\),求\(\ ...
- [转]软件开发规范—模块开发卷宗(GB8567——88)
做软件开发是有那么一套国准可参照的,当然就是那些文档了,这里列出一下所有软件开发的规范文档: 操作手册 用户手册 软件质量保证计划 软件需求说明书 概要设计说明书 开发进度月报 测试计划文档 测试分析 ...
- 学会MySQL索引
原文:https://mp.weixin.qq.com/s/UzWxJ_pVPjU5ip0Z-Y9TdA 什么是索引? 百度百科是这样描述的: 索引是为来加速对表中数据行中的检索而创建的一种分散的数据 ...
- 实现RecyclerView下拉刷新和上拉加载更多以及RecyclerView线性、网格、瀑布流效果演示
实现RecyclerView下拉刷新和上拉加载更多以及RecyclerView线性.网格.瀑布流效果演示 效果预览 实例APP 小米应用商店 使用方法 build.gradle文件 dependenc ...
- 【mysql】mysql增加version字段实现乐观锁,实现高并发下的订单库存的并发控制,通过开启多线程同时处理模拟多个请求同时到达的情况 + 同一事务中使用多个乐观锁的情况处理
mysql增加version字段实现乐观锁,实现高并发下的订单库存的并发控制,通过开启多线程同时处理模拟多个请求同时到达的情况 ==================================== ...
- 【hibernate】错误:org.hibernate.HibernateException: identifier of an instance of com.agen.entity.Monthdetail was altered from xx to xx
所报错误: org.hibernate.HibernateException: identifier of an instance of com.agen.entity.Monthdetail was ...
- python的globals()使用
使用命令pyrasite-shell pid,可以与进程进行shell交互,获取,在shell里执行globals(),可以获取整个进程的全部全局变量,比如django应用.flask应用的变量,而不 ...