Convert a string to a numeric in the rules engine

  • 11 February 2022
  • 1 reply

Userlevel 1

Is it possible to convert a string to a numeric in a rules engine setup step? 

My scenario:

I have a string that is prefixed by numerics (e.g. ‘20.This is the string’).  I can strip the numeric part off by using the left function, but then I want to use that value in a case statement using ranges of numbers, e.g. If A > 1 and A < 10….   


Since the value is a string, it sorts like 1, 100, 2, 210 etc, and my range selections don’t work.

If I could cast the string to a numeric then I would be able to use numeric ranges.  Any thoughts on how to do this?


Best answer by rakesh 14 February 2022, 06:01

View original

1 reply

Userlevel 6

Hi @mary_taylor 

We do not have a direct way to cast to String. Current workaround is to export to S3 in one task and reimport from S3 with a different data type.