Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Ankhi
Creator
Creator

Check if the first character of a field is Text

Hi All,

I need a help on the below requirement please. 

Would like to check if the 1st character of a field is text with a If statement . I am not sure how to or which function to use. 

My field is a alphanumeric one. If the 1st character is string, then I have to update field with a diff value. Else it will be the field value itself.

Can anyone please help?

Many Thanks in advance

Regards

Ankhi

2 Solutions

Accepted Solutions
Or
MVP
MVP

In an alphanumeric field, the first character will always be a string unless the field has a length of 0...

You can use IsNum() and IsText() on Left(YourField,1) to check if it's numeric (or not numeric), I believe.

 

 

View solution in original post

Kushal_Chawda

@Ankhi  you can try something like below

= if( istext(left(Field,1)),'Flag 1','Flag 2')

View solution in original post

4 Replies
Or
MVP
MVP

In an alphanumeric field, the first character will always be a string unless the field has a length of 0...

You can use IsNum() and IsText() on Left(YourField,1) to check if it's numeric (or not numeric), I believe.

 

 

Kushal_Chawda

@Ankhi  you can try something like below

= if( istext(left(Field,1)),'Flag 1','Flag 2')

Ankhi
Creator
Creator
Author

Thanks Kush. It worked

Ankhi
Creator
Creator
Author

Thanks Or The left and IsText combination worked.