Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How do I tell if a record is only made up of spaces?

I know that my record is made of more than one space so I can't use if(len(record)=0,...  How do I tell if it's only made up of spaces?

1 Solution

Accepted Solutions
Not applicable
Author

With Trim() function delete spaces

If(Len(Trim(record))=0, ........

Regards.

View solution in original post

2 Replies
stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

You can check if a field is only spaces by doing the following:

trim(FieldName) = ''

It is usually worth checking for null values as well (these are technically different to blanks but appear similar) by doing:

trim(FieldName) = '' or isnull(FieldName)

If you want to check if a whole record is blank you will need to concatenate your fields or use the and statement:

trim(Field1 & Field2 & Field3) = ''

You will find that if you are loading from a CSV file you will never have null values, but when loading from a spreadsheet or database you could have a mix of nulls and blanks.

Hope that helps.

Steve

http://www.quickintelligence.co.uk/

Not applicable
Author

With Trim() function delete spaces

If(Len(Trim(record))=0, ........

Regards.