Lotus Notes:如何除去值并替换新值 [英] Lotus Notes : How to Remove a value and replace a new value
问题描述
我的问题:如何删除值并替换新值
My Question : How to Remove a value and replace a new value
InvGSTSummary 中的我的字段"值:
值1:
-0%,19291.76,0.00"
"SE 0%,1068.39,0.00"
"ST 6%,2000.00,120.00"
文本列表"的顺序可能每次都会更改
The order of the Text List might change everytime,
值2:
"SE 0%,1068.39,0.00"
-0%,19291.76,0.00"
"ST 6%,2000.00,120.00"
我编写的用于测试的示例公式如下:
InvGSTSumCode = @Word(InvGSTSummary;,"; 1)
- 问题是我可以知道如何将前2个字符为"SE" 将最后3个值修改为(使用1068.39 * 6%= 64.1034) 将最后3个值替换为64.1034
- The question is May i know how to take the First 2 character is "SE" to amend the last 3 value become by (using 1068.39 * 6%=64.1034), than replace the last 3 value become 64.1034
最终结果的值应为:
-0%,19291.76,0.00"
"SE 0%,1068.39,64.10"
"ST 6%,2000.00,120.00"
新更新项目:在08/07/2019
抱歉,我的问题可能不清楚.实际上,我想问的是可以在条件的字段" [文本列表]上循环(如果找到" SE "),而不仅仅是重做其他计算页面.
Sorry may be my question not clear. Actually what i want to ask is possible to Loop over the a "field" [text list] for condition (if found "SE") value than just redo other calculation on the page.
新更新项目:在10/07/2019
提取原始值并替换值的公式
Formula to extract the orignal value and replace value
FullSummary := @Trim(@Replace("SE" + @Right(InvGSTSummary; "SE"); "SE"; ""));
STCode := @Word(FullSummary; ","; 1);
Price := @Word(FullSummary; ","; 2);
SST:=@TextToNumber(Price) * 0.06;
CompVal:= STCode +","+Price+","+@Text(SST; "F2");
CompVal
公式的结果:
推荐答案
- 获取要更改的字段条目,
- 计算条目的新值,
- 替换字段中的条目.
替换以"SE"开头的条目的示例:
Example for replacing entry that starts with "SE":
_entryOld := @Trim(@Replace("SE" + @Right(InvGSTSummary; "SE"); "SE"; ""));
_entryNew := @Word(_entryOld; ","; 1) + ... calculate your new value based on _entryOld;
@Replace(InvGSTSummary; _entryOld, _entryNew);
以下是循环"获取带有"SE"的条目的替代方法:
Here is an alternative for the "loop" to get the entry with "SE":
_entryOld := @Trim(@Transform(InvGSTSummary; "entry";
@If(@Contains(entry; "SE"); entry; "")));
更新为您更新的问题:
在最后一行代码中使用@Replace将旧条目(FullSummary)替换为新值(CompVal):
Use @Replace in last code line to replace the old entry (FullSummary) with the new value (CompVal):
FullSummary := @Trim(@Replace("SE" + @Right(InvGSTSummary; "SE"); "SE"; ""));
STCode := @Word(FullSummary; ","; 1);
Price := @Word(FullSummary; ","; 2);
SST:=@TextToNumber(Price) * 0.06;
CompVal:= STCode +","+Price+","+@Text(SST; "F2");
@Replace(InvGSTSummary; FullSummary, CompVal);
这篇关于Lotus Notes:如何除去值并替换新值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!