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