当前位置:网站首页>Primavera Unifier advanced formula usage sharing

Primavera Unifier advanced formula usage sharing

2022-08-11 09:24:00 Broad bean brother

Oracle Primavera Unifier 虽然很强大,However, in the early version, there was still some controversy due to the rigid data processing,The addition of the advanced formula function improves the flexibility of data processing to a certain extent,At the call of a friend,Here is a simple case to share

(PS. This feature last year20.12 version has been added)

需求:A field is required to reflect both the work order number and the project number,且格式为 “工单号 / 项目编号”

Get this topic naturally and think about the need to make up this field3an independent key element,即:

  • 工单号
  • /
  • 项目编号

The work order number and project number are obviously entered manually,/ 作为连接符 Can be written via a static text“ / ”(注意/There is a space before and after each)

After confirming the idea, it is ready to establish the corresponding elements,(为方便理解,要素IDChinese pinyin is used directly)

  • 工单号:QZ_gongdanhao
  • /:PU_lianjiefu_xiegan
  • 项目编号:GC_fenxiangbianhao 

Use advanced formulas for features that need to be combined

 使用字符串函数 concat(str1, str2)

 需要注意的是concat Only two strings can be connected at the same time,因此 concat(工单号,/ )Once connected it will act as a new onestrReconnecting with the item number will recombine the connection

 进行错误检查,保存关闭,发布BP后 最后效果如下

如此,效果达成!

看到这里,可以发现,It is necessary to have a fixed formula to useIT开发基础,Otherwise, it may be unexpectedly usefulconcat来实现该功能,But something is better than nothing

... 

当然,There are other formulas that use a similar approach,Believe if you have itJAVAThe basics won't let you down

以下是我从ORACLE HELP The corresponding content of the search(基于 Unifier uDesigner User Guide Version 21)

搜索关键词:Advanced Formulas

The core content has been posted,如下,Hope it will help you who are interested

 String 字符串类别

FunctionTooltip
(indexOf(String, int))Starting point of a string within another string starting at a defined point in the string.
(indexOf(String))Starting point of a string within another string starting at the beginning of the string.
(length())Length of a string.
Formating a numeric field to a string, for example: numeric value of 9 with a format of "00000.00" would result in a string of "00009.00".
(startsWith(String, int))Checking to ensure if a string starts within a defined string starting from a defined index. Needs to support indexOf.
(startsWith(String))Checking to ensure if a string starts within a defined string.
(endsWith(String))Checking to ensure if a string ends with a defined string.
(substring(int))Pulling a substring from another string starting at a defined point till the end. This needs to support indexOf.
(substring(int, int))Pulling a substring from another string starting at a defined point till a defined point in the string. This needs to support indexOf.
(concat(String))Concatenating stings including being able to define numeric fields as strings.
(contains(String))Checking to ensure if a string contains another string.
Comparing stringsNot available.

 Numeric 数字类别

FunctionTooltip
(toString(format))Converting a number or currency to a string with a defined format.
(abs())Absolute value of a number
(sqrt())Square root of a number.
(power(int))Raised to the power.
(log())Logarithm Base 10.
(ln())Natural Logaritm.
(min(number, ….))Minimum of a set of numbers.
(max(number, ….))Maximum of a set of numbers.
(ceil())Round up to the smallest integer that is greater than or equal to the value of the field.
(floor())Round down to the largest integer that is less than or equal to the value of the field.
(round(int))Round to the number of decimal places.
Comparingnumbers =, !=, >, >=, <, <=Not available.

补充 详细功能

String FunctionsNumeric FunctionsDate Functions
compare(str1,str2)abs(num)date(year,month,day)
compareIgnoreCase(str1,str2)max(num1,num2)day(date)
concat(str1,str2)min(num1,num2)edate(date,months)
contains(str,search)ceil(num)eomonth(date,months)
containsAny(str,search1,search2,...)floor(num)month(date)
containsIgnoreCase(str,search)log(num)now()
endsWith(str,suffix)log10(num)today()
endsWithIgnoreCase(str,suffix)pow(base,exponent)weekday(date)
indexOf(str,search)round(num,places)weeknum(date)
indexOfAny(str,search1,search2,...)sqrt(num)year(date)
indexOfIgnoreCase(str,search)isNumber(num)addDays(date,amount)
isAlpha(str)numberFormat(num,pattern)addHours(date,amount)
isBlank(str)toDouble(num)addMonths(date,amount)
isEmpty(str)toInt(num)addWeeks(date,amount)
isNumeric(str)toLong(num)addYears(date,amount)
isNumericSpace(str)cos(num)dateDiff(start,end)
lowerCase(str)sin(num)dateFormat(date,pattern)
upperCase(str)tan(num)isSameDay(date1,date2)
matches(str,regex)acos(num)toLong(date)
left(str,len)asin(num)toDate(long)
leftPad(str,size)atan(num) 
leftPad(str,size,padStr)cosh(num) 
mid(str,pos,len)sinh(num) 
right(str,len)tanh(num) 
rightPad(str,size)  
rightPad(str,size,padStr)  
replace(str,search,replacement)  
replaceAll(str,regex,replacement)  
replaceFirst(str,regex,replacement)  
startsWith(str,prefix)  
startsWithIgnoreCase(str,prefix)  
size(str)  
strip(str)  
substring(str,start)  
substring(str,start,end)  
truncate(str,maxlen)  

The above is just an example of advanced formula usage,If other scenarios are used, it cannot be realized/Or if you don't know it can't be achieved, you can consult me.

 这个行业的分享不多,希望更多感兴趣的朋友一同参与,探讨或合作 !

本人可提供Oracle 多种产品技术服务,包括产品的部署和维护及培训,欢迎与我取得联系!
如何联系蚕豆哥_蚕豆哥的博客-CSDN博客电邮:[email protected] (@gmail.com,@outlook.com)https://campin.blog.csdn.net/article/details/52950969

原网站

版权声明
本文为[Broad bean brother]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/223/202208110908088375.html