Skip to main content
Solved

Convert a string to a numeric in the rules engine

  • February 11, 2022
  • 1 reply
  • 400 views

mary_taylor
Forum|alt.badge.img
  • Contributor ⭐️⭐️⭐️⭐️
  • 31 replies

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

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.

View original
Did you find this topic helpful?

1 reply

rakesh
Forum|alt.badge.img+1
  • Lets put your data to work!
  • 835 replies
  • Answer
  • February 14, 2022

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.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings