您的位置:首页 > 其它

Transformation language 方法 IN, MAX

2012-11-23 14:24 399 查看

IN()

Matchesinputdatatoalistofvalues.默认情况下,匹配时大小写敏感。

语法
IN( valueToSearch,value1,[value2,...,valueN,]CaseFlag)
查找的值valueToSearch可以是String,date或者numericvalue。CaseFlag必须是整数,当为0或者空时,大小写不敏感,为其他整数时,大小写敏感。

返回值
TRUE(1),查找值存在于值列表中
FALSE(0),查找值不在值列表中
NULL,输入值为空时

例子

IN(ITEM_NAME,‘ChiselPointKnife’,‘MediumTitaniumKnife’,‘SafetyKnife’,0)


ITEM_NAME

返回值

StabilizingVest

0(FALSE)

Safetyknife

1(TRUE)

MediumTitaniumknife

1(TRUE)


NULL

MAX()

Returnsthelatestdate, thelargestnumericvalueorthehigheststringvalue withinaportorgroup.Youcanapplyafiltertolimittherowsinthesearch.YoucannestonlyoneotheraggregatefunctionwithinMAX. 

Note:TheMAXfunctionusesthesamesortorderthattheSortertransformationuses.However,theMAXfunctioniscasesensitive,andtheSortertransformationmaynotbecasesensitive. 

语法

MAX(date/numeric_value/string[,filter_condition])

过滤条件是可选的,过滤条件必须是数字值或者等于TRUE,FALSE,NULL。

当通过的所有值为空,或者是过滤条件为假或者空时,返回值是NULL。

GroupBy:

Max函数基于在transformation中定义的groupbyport分组,一组一个返回值,如果没有定义groupbyport,则将所有值看成一组,返回一个值。

例子:

返回flashlights的最高价格:
MAX(PRICE,ITEM_NAME='Flashlight')


ITEM_NAME

PRICE

Flashlight

10.00

RegulatorSystem

360.00

Flashlight

55.00

DivingHood

79.00

HalogenFlashlight

162.00

Flashlight

85.00

Flashlight

NULL

返回值:85.00

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
相关文章推荐