We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

How to Make a Number and Comma combination from a single number in Formula or Other?

JessicaXChung
6 - Meteoroid

I've attached an Alteryx workflow for reference, essentially I can't quite think of a way to write a formula that will generate a number and comma combination from a single number.

What I am looking for is:

Input

Input - Single numberOutput - Each number going up to the number with a comma in between. No comma at end
41,2,3,4
51,2,3,4,5
61,2,3,4,5,6
71,2,3,4,5,6,7

 

Has anyone done this before and how was it done? I'm thinking that I have to do some multi row formula but I'd really like to have it done in Formula. An option I am thinking of is to use a for loop in the Formula tool itself is that possible?

 

2 REPLIES 2
alexnajm
18 - Pollux
18 - Pollux

Something like this?

DataNath
17 - Castor
17 - Castor

Hey @JessicaXChung, you can generate rows up to the number in your reference field. After that, just convert the new field to a string data type and you can concatenate the values in a Summarize tool, grouping on your original field:

 

DataNath_0-1680533680464.pngDataNath_1-1680533687155.png

Labels
Top Solution Authors