Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Count Characters

I have a field that is numeric and I need to only select the ones that have 3 numeric characters.  How can I accomplish this?

What would the code be to flag the three digit elements?

If(Codes Character Count = 3, 'Three digit Flag', 'Other') AS [Digit Count],

Codes

02

03

04

111

222

333

Three digit Flag would return:

111

222

333

Other would return

02

03

04

Thanks in advance.

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Try len(Codes) or len(trim(Codes)):

e.g. as list box field expression:

=if(len(Codes)=3,Codes)

Hope this helps,

Stefan

View solution in original post

3 Replies
swuehl
MVP
MVP

Try len(Codes) or len(trim(Codes)):

e.g. as list box field expression:

=if(len(Codes)=3,Codes)

Hope this helps,

Stefan

Not applicable
Author

Thanks swuehl, the Trim() solve my issue. 

Johan_Kassing
Contributor II
Contributor II

Thank you