Hey all,
I was working through a folder full of SQL scripts (studying to renew my SQL server exam), and wanted to separate out the words which are in upper case to make sure that I'd covered all the keywords involved in the exam.
However, after stripping this all back to a stream of unique words - it turned out that checking for upper-case is not a simple function (or am I missing it).
- Tried this with regex - very possible but a bit messy
- Then thought "well - why not apply logic"
- if a string is equal to it's upper case version, then it's already upper case. e.g. "CAT" == uppercase("CAT")
- Unfortunately, I couldn't find how to force Alteryx to do a case-sensitive equality check on two strings - I was getting true with "cat" == "CAT"
- eventually resorted to a formula which cheats using the StartsWith function which has a case sensitivity argument.
StartsWith([InputRow], [UpperInputRow],0) AND startswith([UpperInputRow],[InputRow],0)
- This works because if text A starts with text B; AND text B starts with text A, then they are equal.
But there has to be a better way, no?
Aside from using RegEx - is there a simpler way to check if a string is in upper-case; and to case-sensitive-compare two strings for equality?
Thank you
Sean
cc: @ydmuley