cancel
Showing results for 
Search instead for 
Did you mean: 

Create a group based on the numeric values

GSG
Participant
0 Kudos
150

Hello All,

I am seeking help to create a group based on numeric values. I have data values like 101, 101 BD, 102, 102BD and so on. I want to create a group based on numbers. The groups would be like 101, 102, 103 and so on. Please advise. I would appreciate your help. Thanks

Accepted Solutions (1)

Accepted Solutions (1)

abhilash_kumar
Active Contributor
0 Kudos

Hi Gurpreet,

You'd need to traverse the string and extract the numbers. Create a formula with this code and use it as the group:

local numbervar i;
local stringvar ID := {table.stringField};
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);
)

-Abhilash

Answers (1)

Answers (1)

GSG
Participant
0 Kudos

Thank you Abhilash, the provided solution works for me.