Hi All,
I'm really sorry to ask this as it seems such a stupid question.
Whilst digesting some formulas that I'd not used before I was looking at PadLeft and PadRight and tried two very simple scenarios but the results didn't quite match what I was expecting. I'm currently using Designer x64 version 2020.4.5
PadLeft (String, len, char)
PadLeft("abc", 4, "x")
PadRight("abc", 4, "x")
I was expecting the outputs to be:
xxxxabc
abcxxxx
but what I got was
If I change the initial 'string' to just a character then this works but the documentation says this can be a string so I'm a bit confused.
I'm really sorry to ask as I know this sounds silly but am I missing something obvious.
Thank you.
Solved! Go to Solution.
Hi @brandowd
How Pad functions work is it will add the specified character to left or right to meet the specified length. Observe below example its padding to maintain length 7.
Hope this helps : )
The Functions page includes an example for each function: https://help.alteryx.com/20212/designer/functions
From https://help.alteryx.com/
click Designer > Overview, then Functions on the left
Thanks Chris, I now see the error of my ways. A simple case of PEBCACK. I took the "len" as number of "char" to add rather than total length of string. What a muppet I am.
Thank you once again.