ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

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

Most Effective method to group records by letter?

Claje
Magnetar

Hi,

I have a field with letters A-Z in it.  I want to split my data into four "buckets"

 

A-F
G-L
M-R

S-Z

 

I recognize that I can call out every single option in a SWITCH statement, or write a REGEX_MATCH for each of these, but is there a smarter way to handle a problem like this?

The particular function that I can't seem to reliably create is some sort of "Position in Alphabet".  Is this something that exists which I just haven't found?

3 ANTWORTEN 3
Bob_Blackey
Bolide

Here's one way - 

 

You could use the formula tool and the formula (with the example column "letter")

 

CharToInt([Letter])-64

 

which give you the position.

 

You could then use the Tile tool to set up the groupings.

 

Claje
Magnetar

Ah - I think what I was missing is the need to normalize the data.

I tried that and was getting inconsistent results, not thinking of the fact that A/a would naturally have different integer values.

 

Thanks!

Bob_Blackey
Bolide

Glad to help - you can use the Uppercase() function to normalize to uppercase.

 

Cheers,

Bob

 

Beschriftungen
Top-Lösungs-Autoren