Lotus Notes : How to Remove a value and replace a new value

我的未来我决定 提交于 2019-12-11 06:28:28

问题


My Question : How to Remove a value and replace a new value

My Field value inside InvGSTSummary :

Value 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,

Value 2:

"SE 0%,1068.39,0.00"

"- 0%,19291.76,0.00"

"ST 6%,2000.00,120.00"

Sample formula i write for testing as below :

InvGSTSumCode = @Word(InvGSTSummary; ","; 1)

  1. 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

Final Result For the value should be :

"- 0%,19291.76,0.00"

"SE 0%,1068.39,64.10"

"ST 6%,2000.00,120.00"

New Update item: on 08/07/2019

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.

New Update item: on 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

Result of the formula:


回答1:


  1. Get field's entry you want to change,
  2. Calculate entry's new value,
  3. Replace entry in field.

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);

Here is an alternative for the "loop" to get the entry with "SE":

_entryOld := @Trim(@Transform(InvGSTSummary; "entry"; 
                              @If(@Contains(entry; "SE"); entry; "")));

Update to your updated question:

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);


来源:https://stackoverflow.com/questions/56896485/lotus-notes-how-to-remove-a-value-and-replace-a-new-value

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!