Hello Friends
I have series of numbers like the below table. The first TWO characters could be 3P or SZ or 5T or 11.
The requirement is that I need to remove the first couple of characters only if it is a combination of alphanumeric. If they are pure numeric like 11, I need to pad it with ZEROES for a total length of 10. For padding I can use the function padleft but please suggest about the first requirement
Input | Expected Output | Length of expected output |
3P0000311575 | 0000311575 | 10 |
SZ0000356789 | 0000356789 | 10 |
SZ00003567 | 0000003567 | 10 |
5T0000356789 | 0000356789 | 10 |
1100003567 | 1100003567 | 10 |
11000035 | 0011000035 | 10 |
110000356 | 0110000356 | 10 |
1100003 | 0001100003 | 10 |
Thanks
Solved! Go to Solution.
Can you show us the expected output to be safe?
Thank you! This works for me for the data provided: IF REGEX_Match([Input], "\d+") THEN PadLeft([Input], 10, '0') ELSE PadLeft(Substring([Input],2,10), 10, '0') ENDIF
if Left([Input], 2) in ("3P","SZ","5T") then
Substring([Input],2,10)
else
[input]
endif
User | Count |
---|---|
106 | |
82 | |
70 | |
54 | |
40 |