cancel
Showing results for 
Search instead for 
Did you mean: 

How to compare several strings

former_member246543
Participant
0 Kudos

Hi,

I want to compare the first character of a batch number in the expression editor of an action block and check if it is an alpha character.how to compare with all the 26 alpha characters.Is there any way to compare as we have in SQL as [A-Z].

e.g: if my batch number is F012345 or S012345,i want to exclude these. and if my batch number is 7012345 or 5012345,I want to include this.

Thanks in advance,

Sanjeev

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi sanjeev,

I can suggest following solution:

take one local variable suppose x=F012345

than use stringleft and number function to verify first character is string or number.

Take first character of your batch number using string function.

stringleft(X,1)=F

Check wheather it is number or not by number function

number(stringleft(X,1))=0

but before number function you have to check stringleft(X,1) != 0

Than I think your logic will work.

Regards,

Manoj Bilthare

former_member246543
Participant
0 Kudos

Hi Manoj,

Thanks for your reply.

That logic is working but will be a bulky logic in my transaction as I am using a switch block with 11 inputs and hence I will have to give two additional conditional blocks for every case.

Anyways,if I do not get anything else,I will apply this only.

Thanks

Sanjeev

Former Member
0 Kudos

Hi Sanjeev,

I dont know your requirement but if your switch is having Batch number as input than you can put this logic before switch.

hope this helps!!

Regards,

Manoj bilthare

former_member246543
Participant
0 Kudos

Hi Manoj,

It was not possible for me to give those conditions before switch as you suggested,however,I gave it a thought and was able to replace the switch block having 12 inputs,with 3 conditional blocks and then implemented your previous logic.

It is working perfectly now.

Thanks

Sanjeev

Answers (0)