SOLVED
Repeating a text string based on numeric input
Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Willox
5 - Atom
09-14-2018
12:16 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Say I have some data representing the number of A grades a student achieved at A Level like so:
| Student | Number of A grades |
| 1 | 3 |
| 2 | 2 |
| 3 | 0 |
For the purposes of analysis, I need to turn this data into a string, like so:
| Student | A Level Band |
| 1 | AAA |
| 2 | AA |
| 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?
Solved! Go to Solution.
Labels:
- Labels:
- Preparation
4 REPLIES 4
17 - Castor
09-14-2018
01:09 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Would this work for you?
ponraj
13 - Pulsar
09-14-2018
05:36 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Paul-Evans
9 - Comet
05-15-2020
05:58 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
17 - Castor
12-18-2023
10:52 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Used this today - thank you @DavidP
