热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

kettle--组件(2)--计算器

组件如下:对计算类型的说明如下:Thetablebelowcontainsdescriptionsassociatedwiththecalculatorstep:

组件如下:

对计算类型的说明如下:

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 . 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
 
 
个人理解:
自己再处理单列加常量数值的使用用到这里,可以组件里定义一个常量数值,然后第二行引用,做进一步运算。
 

推荐阅读
  • CF:3D City Model(小思维)问题解析和代码实现
    本文通过解析CF:3D City Model问题,介绍了问题的背景和要求,并给出了相应的代码实现。该问题涉及到在一个矩形的网格上建造城市的情景,每个网格单元可以作为建筑的基础,建筑由多个立方体叠加而成。文章详细讲解了问题的解决思路,并给出了相应的代码实现供读者参考。 ... [详细]
  • Linux重启网络命令实例及关机和重启示例教程
    本文介绍了Linux系统中重启网络命令的实例,以及使用不同方式关机和重启系统的示例教程。包括使用图形界面和控制台访问系统的方法,以及使用shutdown命令进行系统关机和重启的句法和用法。 ... [详细]
  • 开发笔记:加密&json&StringIO模块&BytesIO模块
    篇首语:本文由编程笔记#小编为大家整理,主要介绍了加密&json&StringIO模块&BytesIO模块相关的知识,希望对你有一定的参考价值。一、加密加密 ... [详细]
  • IB 物理真题解析:比潜热、理想气体的应用
    本文是对2017年IB物理试卷paper 2中一道涉及比潜热、理想气体和功率的大题进行解析。题目涉及液氧蒸发成氧气的过程,讲解了液氧和氧气分子的结构以及蒸发后分子之间的作用力变化。同时,文章也给出了解题技巧,建议根据得分点的数量来合理分配答题时间。最后,文章提供了答案解析,标注了每个得分点的位置。 ... [详细]
  • 本文介绍了一个在线急等问题解决方法,即如何统计数据库中某个字段下的所有数据,并将结果显示在文本框里。作者提到了自己是一个菜鸟,希望能够得到帮助。作者使用的是ACCESS数据库,并且给出了一个例子,希望得到的结果是560。作者还提到自己已经尝试了使用"select sum(字段2) from 表名"的语句,得到的结果是650,但不知道如何得到560。希望能够得到解决方案。 ... [详细]
  • 【shell】网络处理:判断IP是否在网段、两个ip是否同网段、IP地址范围、网段包含关系
    本文介绍了使用shell脚本判断IP是否在同一网段、判断IP地址是否在某个范围内、计算IP地址范围、判断网段之间的包含关系的方法和原理。通过对IP和掩码进行与计算,可以判断两个IP是否在同一网段。同时,还提供了一段用于验证IP地址的正则表达式和判断特殊IP地址的方法。 ... [详细]
  • 本文介绍了一个适用于PHP应用快速接入TRX和TRC20数字资产的开发包,该开发包支持使用自有Tron区块链节点的应用场景,也支持基于Tron官方公共API服务的轻量级部署场景。提供的功能包括生成地址、验证地址、查询余额、交易转账、查询最新区块和查询交易信息等。详细信息可参考tron-php的Github地址:https://github.com/Fenguoz/tron-php。 ... [详细]
  • 本文讨论了如何优化解决hdu 1003 java题目的动态规划方法,通过分析加法规则和最大和的性质,提出了一种优化的思路。具体方法是,当从1加到n为负时,即sum(1,n)sum(n,s),可以继续加法计算。同时,还考虑了两种特殊情况:都是负数的情况和有0的情况。最后,通过使用Scanner类来获取输入数据。 ... [详细]
  • 本文介绍了Oracle数据库中tnsnames.ora文件的作用和配置方法。tnsnames.ora文件在数据库启动过程中会被读取,用于解析LOCAL_LISTENER,并且与侦听无关。文章还提供了配置LOCAL_LISTENER和1522端口的示例,并展示了listener.ora文件的内容。 ... [详细]
  • 配置IPv4静态路由实现企业网内不同网段用户互访
    本文介绍了通过配置IPv4静态路由实现企业网内不同网段用户互访的方法。首先需要配置接口的链路层协议参数和IP地址,使相邻节点网络层可达。然后按照静态路由组网图的操作步骤,配置静态路由。这样任意两台主机之间都能够互通。 ... [详细]
  • This article discusses the efficiency of using char str[] and char *str and whether there is any reason to prefer one over the other. It explains the difference between the two and provides an example to illustrate their usage. ... [详细]
  • SpringMVC接收请求参数的方式总结
    本文总结了在SpringMVC开发中处理控制器参数的各种方式,包括处理使用@RequestParam注解的参数、MultipartFile类型参数和Simple类型参数的RequestParamMethodArgumentResolver,处理@RequestBody注解的参数的RequestResponseBodyMethodProcessor,以及PathVariableMapMethodArgumentResol等子类。 ... [详细]
  • 本文讨论了编写可保护的代码的重要性,包括提高代码的可读性、可调试性和直观性。同时介绍了优化代码的方法,如代码格式化、解释函数和提炼函数等。还提到了一些常见的坏代码味道,如不规范的命名、重复代码、过长的函数和参数列表等。最后,介绍了如何处理数据泥团和进行函数重构,以提高代码质量和可维护性。 ... [详细]
  • 本文讨论了在VMWARE5.1的虚拟服务器Windows Server 2008R2上安装oracle 10g客户端时出现的问题,并提供了解决方法。错误日志显示了异常访问违例,通过分析日志中的问题帧,找到了解决问题的线索。文章详细介绍了解决方法,帮助读者顺利安装oracle 10g客户端。 ... [详细]
  • 合并列值-合并为一列问题需求:createtabletab(Aint,Bint,Cint)inserttabselect1,2,3unionallsel ... [详细]
author-avatar
品味a江湖_232_466
这个家伙很懒,什么也没留下!
Tags | 热门标签
RankList | 热门文章
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有