How to check String or Numeric data

Avatar

Avatar
Validate 1
Level 2
tejashriw155148
Level 2

Likes

12 likes

Total Posts

70 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Give Back 5
Give Back 3
Give Back
Boost 5
View profile

Avatar
Validate 1
Level 2
tejashriw155148
Level 2

Likes

12 likes

Total Posts

70 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Give Back 5
Give Back 3
Give Back
Boost 5
View profile
tejashriw155148
Level 2

28-04-2020

Hi,

 

Suppose Code field contain below data:

02

38

LG

TR

 

I'm not sure how to find field equal to string, tried below logic but its showing error.

 

When(case(@code Equal to String,'@code'), Else ToInt64(@code))

 

Please let me know how to find data is string or not if its not string then convert it to ToInt64.

 

Thanks,

 

 

 

 

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Contributor
MVP
Milan_Vucetic
MVP

Likes

167 likes

Total Posts

386 posts

Correct reply

135 solutions
Top badges earned
Contributor
Springboard
Shape 1
Validate 25
Validate 10
View profile

Avatar
Contributor
MVP
Milan_Vucetic
MVP

Likes

167 likes

Total Posts

386 posts

Correct reply

135 solutions
Top badges earned
Contributor
Springboard
Shape 1
Validate 25
Validate 10
View profile
Milan_Vucetic
MVP

30-04-2020

Hi @tejashriw155148,

 

you must do a split after query selection to get two branches (one for INT and another for STRING).

After that you may convert to  preferred type in Enrichment nodes in needed (per branch.)

 

If your data have only two characters you may adapt query in split:

  1. To identify numbers something like: first character in (1,2,3,4,5,6,7,8,9) and second character in (1,2,3,4,5,6,7,8,9)
  2. To identify non-numbers just enable Complement of point 1 to get all non-numbers

 

Generally, with provided data all input values are string. Then you need to separate it with split (above) and do conversion of numbers to integer.

 

Regards,

Milan

Answers (1)

Answers (1)

Avatar

Avatar
Validate 1
MVP
Darren_Bowers
MVP

Likes

90 likes

Total Posts

287 posts

Correct reply

87 solutions
Top badges earned
Validate 1
Affirm 50
Establish
Give Back 3
Applaud 25
View profile

Avatar
Validate 1
MVP
Darren_Bowers
MVP

Likes

90 likes

Total Posts

287 posts

Correct reply

87 solutions
Top badges earned
Validate 1
Affirm 50
Establish
Give Back 3
Applaud 25
View profile
Darren_Bowers
MVP

28-04-2020

Hi @tejashriw155148 I posted up some code to do this in your other post here: https://experienceleaguecommunities.adobe.com/t5/adobe-campaign-classic-questions/convert-string-to-...

Remember you can't have two data types in the same output column. It has to be either string or numeric and alpha strings cant be converted to numeric