To extract the last integer value from a text field following the final hyphen (-), the formula below can be used:
CASE
WHEN INSTR({field}, '-', -1) > 0
THEN TO_NUMBER(SUBSTR({field}, INSTR({field}, '-', -1) + 1))
ELSE NULL
END
To extract the last integer value from a text field following the final hyphen (-), the formula below can be used:
CASE
WHEN INSTR({field}, '-', -1) > 0
THEN TO_NUMBER(SUBSTR({field}, INSTR({field}, '-', -1) + 1))
ELSE NULL
END