Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Character Count

Birdman1971
7 - Meteor

Hi everyone 

 

I am using Length to count characters in a single column but it errors - what am i doing wrong ? 

 

Any help appreciated. 

 

Many thanks

5 REPLIES 5
Deano478
12 - Quasar

@Birdman1971 Can you post a screenshot of the error message your getting and your function configuration?

ChrisTX
16 - Nebula
16 - Nebula

The error you're encountering when using the Length function in Alteryx could be due to a few common reasons. Here are some things to check:

  1. Data Type: Ensure that the column you are trying to measure the length of is a string (text) data type. The Length function works on string fields. If your column is of a different type (e.g., numeric or date), you'll need to convert it to a string using the ToString() function first.

    Example:

    Length(ToString([YourColumn]))
  2. Null Values: If there are null values in your column, the Length function might throw an error. You can handle nulls by using the IF function to replace them with an empty string or another value.

    Example:

    Length(IF IsNull([YourColumn]) THEN "" ELSE [YourColumn] ENDIF)
  3. Formula Syntax: Ensure that the syntax of your formula is correct. The formula should be structured as:

    Length([YourColumn])
  4. Special Characters: If your data includes special characters or unexpected data, this might cause an issue. Ensure that the data is clean and consistent.

If you check these areas and still face issues, could you provide more details on the specific error message you're getting?

Birdman1971
7 - Meteor

Thanks Deano - sometimes the obvious is the one we ignore ! 

Birdman1971
7 - Meteor

Thanks Deano !

elianacroo
5 - Atom

Hi Birdman1971, If you're encountering errors while using the Length function in your current method to count characters, it might be worth double-checking the data formatting or function usage. That said, if you're looking for a simpler solution, you can try this free tool: pdf character counter. This tool allows you to upload text or PDF files, and it instantly calculates the character count, including or excluding spaces. If your data can be exported as a text or PDF file, this might save you a lot of hassle! Let me know if you need further assistance. Best regards,
Eliana Crooz

Labels
Top Solution Authors