Alteryx Designer Desktop Discussions

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

Repeating a text string based on numeric input

Willox
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?

4 REPLIES 4
DavidP
17 - Castor
17 - Castor

Would this work for you?

 

padright string.png

ponraj
13 - Pulsar

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

 

WorkflowWorkflowResultsResults

Paul-Evans
9 - Comet

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.

SeanAdams
17 - Castor
17 - Castor

 Used this today - thank you @DavidP 

Labels