Red Gate forums :: View topic - Controlling the distribution of generated data
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Data Generator 1
SQL Data Generator 1 forum

Controlling the distribution of generated data

Search in SQL Data Generator 1 forum
Post new topic   Reply to topic
Jump to:  
Author Message
ranjeet



Joined: 17 Aug 2011
Posts: 3

PostPosted: Wed Aug 17, 2011 7:12 am    Post subject: Controlling the distribution of generated data Reply with quote

HI
Is there any means by which we can control the distribution of generated test data.

i.e I have a 'VISIT' table with a column name 'VISIT TYPE' [with any one of three types of input data 'Inpatient','Outpatient' or 'Emergency'], so i would like to generate the data in such a manner that 60% of the generated data should be 'Inpatient', 20% should be 'Outpatient' and 20% should be 'Emergency'.[If we are generating 100 rows for visit table then 'VisitType' column should contain 60-Inpatient , 20-Outpatient,20-Emergency data rows]

Regards,
Ranjeet
Back to top
View user's profile Send private message
james.billings



Joined: 16 Jun 2010
Posts: 1123
Location: My desk.

PostPosted: Thu Aug 18, 2011 1:59 pm    Post subject: Reply with quote

There is a "weighted list" generator under "Generics" that may do what you want.

You could add the values as:

Inpatient 6
Outpatient 2
Emergency 2
Back to top
View user's profile Send private message
ranjeet



Joined: 17 Aug 2011
Posts: 3

PostPosted: Fri Aug 19, 2011 6:10 am    Post subject: Reply with quote

Hi
Thanks for the reply.I tried to generate the data with the "Weighted List" as you mentioned.But it is not generating exact number of rows

for eg: When I tried to generate 100 rows .it will generate 55 -Inpatient,25-Outpatient and 15-Emergency.
If i generate only 10 rows then it will generate 7-Inpatient , 3-Outpatient and it will not generate any Emergency values.


Regards,
Ranjeet.
Back to top
View user's profile Send private message
james.billings



Joined: 16 Jun 2010
Posts: 1123
Location: My desk.

PostPosted: Fri Aug 19, 2011 7:58 am    Post subject: Reply with quote

You could try specifying the figures as percentages - i.e. 60,20,20. Does that help? If not, I'll probably need to raise a bug for it not working quite correctly.
Back to top
View user's profile Send private message
ranjeet



Joined: 17 Aug 2011
Posts: 3

PostPosted: Fri Aug 19, 2011 8:14 am    Post subject: Reply with quote

Hi
I tried with 60%,20%,20% and it is generating 'Inpatient-55','Outpatient-25'and 'Emergency-20' and my seed value is 3068.If you need any info please let me know.

Regards,
Ranjeet
Back to top
View user's profile Send private message
james.billings



Joined: 16 Jun 2010
Posts: 1123
Location: My desk.

PostPosted: Fri Aug 19, 2011 10:44 am    Post subject: Reply with quote

I've tested this out some more and it does seem to be not working correctly.

I've raised a bug (SDG-945) for this to get looked at; although I'm not sure when this will be unfortunately.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group