cancel
Showing results for 
Search instead for 
Did you mean: 

Group Formula of a field

GSG
Participant
0 Kudos

Hello All,

I have created a Group formula as follows:

local numbervar i;
local stringvar ID := {Command.EVSTRNAME};
local stringvar ID2;
If isnumeric(ID) Then
tonumber(ID)
Else
(
for i := 1 to len(ID) do
(
if ID[i] IN ['0' to '9'] then
ID2 := ID2 & ID[i];
);
tonumber(ID2);
)

It only shows numeric values in the groups and ignores all values with strings as suffixes. I need help if the above formula shows 101AA in the group. Please let me know if you have any questions. Would appreciate the help

 

 

 

 

Accepted Solutions (0)

Answers (1)

Answers (1)

ido_millet
Active Contributor
0 Kudos

If the alpha characters are always at the end, you can simply use:

ToText(Val(input),0,"");

 

GSG
Participant
0 Kudos
Thank you for your reply. Alpha characters are not always there, we add alfa characters occasionally.
ido_millet
Active Contributor
0 Kudos
My solution works if alpha characters -- if they are present -- are at the end.
GSG
Participant
0 Kudos
Is it will be the new formula or edit the exiting formula as stated in my initial question?
ido_millet
Active Contributor
0 Kudos
It completely replaces your formula. Much simpler because the Val() function extracts the numeric portion at the start of a string.