Hey Guys,
Trying to create some dummy data for a project. I have sample dataset of 1000 doctors and there is a feild called speciality which has certain list of values i want to randomly allocate each docter value from that very list of 10 values.
Sample data
Docid Docname
1 A
2 B
3 C
4 D
Speciality
Oconology
Dentist
My output should be randomly generated as :
Docid Docname Speciality
1 A Dentist
2 B Oconology
3 C Dentist
4 D Dentist
Thank you in advance
Solved! Go to Solution.
Hi akshatkumar87,
To clarify, you want to randomly assign one of 10 specialties to each doctor in your dataset?
Check out the attached workflow. I use the RandInt function in a formula tool to create a random integer for each doctor. I then join that to a list of the specialties, each with their own assigned integer. Here is a picture of the workflow too.
Hope this helps! Please mark this post as the solution if it does!
--DultonM
Hey Dulton,
Thank you so much for your response actually i am not being able to see your solution can you reupload for 10.1 version of it i have the older version ?
Also i need randomly assign values of already generated values for Docter... I already have a list of 10 speciality.
Thanks again
You can use my macro https://gallery.alteryx.com/#!app/Modify-Alteryx-Workflow-Version/5773f9c33df7da0e58dc82d3 to modify the yxmd to your version. Create a new workflow with the macro as the only tool and it will change the version so that you can open it.
Hi!
Open the workbook with any text editor and replace 10.5 you can find at the second row with 10.1
<AlteryxDocument yxmdVer="10.5">
replace with
<AlteryxDocument yxmdVer="10.1">
Then save and you will be able to open the workflow.
Replacing version didnt work
Thanks for version work-arounds Mark and Federica!
akshatkumar87 - I'm surprised the version change did not work. I made Federica's edit to the XML on my end and reattached, but that may not work for you either. Are you sure you have 10.1?
Maybe I can explain a little more so you don't need my workflow. If you look back at the picture from my last post, the top right text input simply assigns an integer to each specialty like this:
0 | Oconology |
1 | Dentist |
2 | Radiology |
3 | etc |
4 | etc |
5 | etc |
6 | etc |
7 | etc |
8 | etc |
9 | etc |
10 | etc |
The Join compares the random number from the formula tool (formula = "RandInt(9)" so the randomly generated integers go from 0 to 9, giving you 10 numbers to correspond to your specialties) to the integer in the first column of the table above, effectively assigning a specialty to each doctor randomly. The Select and Sort tools are just there to reorganize the data.
You need to replace the yxmdVer version with 10.0 for version 10.1
I got the concept now thanks a lot !!
Awesome!! You are welcome!