Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
SOLVED

Repeating a text string based on numeric input

Highlighted
5 - Atom

Say I have some data representing the number of A grades a student achieved at A Level like so:

StudentNumber of A grades
13
22
30

 

For the purposes of analysis, I need to turn this data into a string, like so:

 

StudentA Level Band
1AAA
2AA
3 

 

In Excel, this is achievable using the =REPT() Function, which repeats a specified text string a number of times based on a numeric input. Is this possible in Alteryx?

Highlighted
15 - Aurora

Would this work for you?

 

padright string.png

Highlighted
13 - Pulsar

Here is the sample workflow for your case.  Hope this is helpful. 

 

WorkflowWorkflowResultsResults

Highlighted
8 - Asteroid

And for those here looking to do this with strings of more than a single character, modify @DavidP's response with a REPLACE function.

Replace(PadRight('',3,'.'),'.','TEXT') would result in TEXTTEXTTEXT.

Labels