Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Len() not showing the length of my data correctly!

I am using the len() function in a numeric field to reduce the records but the function doesn't seem to be working correctly.

What do you think might be causing this?

Lentrim.png

Len.png

14 Replies
swuehl
MVP
MVP

laleh haidari,

sorry for getting a very little off topic.

If you are using Rob's expression in your table chart, what do you get? Could you post a screenshot?

Anonymous
Not applicable
Author

Hi all,

So, I managed to solve this using a combination or Num() and PurgeChar() in the script. Stefan! the chr(160) in your earlier reply had definitely pointed me to the right direction. Here's my expressions:

     Num(PurgeChar(gmeternumber, chr(32) & chr(160)) )                     AS gmeternumber_Purged

     Len(Num(PurgeChar(gmeternumber, chr(32) & chr(160))) )           AS gmeternumber_Len

And the result

solved.png

Thanks again for your insights,

swuehl
MVP
MVP

You're welcome.

If your issue is resolved, then please close this thread by marking helpful / correct answers.

Qlik Community Tip: Marking Replies as Correct or Helpful

Anonymous
Not applicable
Author

Marked already!

help.png

prieper
Master II
Master II

What would be wrong in using KEEPCHAR?

e.g. KEEPCHAR(MyField, '0123456789')

else you may build a string with "allowed" ASCII-characters (CHR(48)-CHR(57), CHR(65) - CHR(90), CHR(97)-CHR(122) and put this variable into the above KEEPCHAR.

Peter