Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
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