community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

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

Use variable to generate data

Highlighted
Meteor

Hi,

 

Please see my example attached. I need to generate some sample data for simulation purposes.

With the multi row tool ID's are added to the data (see comment in workflow), this is bases on a fixed number of rows, the next step is to group them

I need the number of row's to be variable. Let's say between 1 and 10. 

 

Is there any way to do that?

 

Thanks,

Yury

Pulsar

Something like the attached?  Each time this is run, it will produce a random number from 1 to 10, and the grouping will be based on that value.

 

Alteryx Certified Partner
Alteryx Certified Partner

@Yury_Brunt

 

In a Formula tool I used the RandInt( function to produce a random group size, then generated rows for each group. This is highly likely to produce a list of group assignments larger than the records, but I just used a position-based Join to used the necessary group assignments back to the original.

 

Solution attached.

Alteryx Certified Partner
Alteryx Certified Partner

EDIT: Removed.

Meteor

Thanks @CharlieS, nice solution think this can do the trick.

Meteor

Thanks @Quasar, but i needed the individual groups to be variable from size.

Pulsar

Ah, I gotcha.  I thought you were saying a random size of group, but each group the same size.

 

For the sake of giving multiple options, so here's another solution to go along with @CharlieS's.  Wanted to see if I could get it all in a single stream :)

Alteryx Certified Partner
Alteryx Certified Partner

Very nice solution, @danrh

Labels