Controlling the distribution of generated data

The simplest way to populate your database with test data.

Moderators: David Atkinson, Anu Deshpande, Lionel

Controlling the distribution of generated data

Postby ranjeet » Wed Aug 17, 2011 7:12 am

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
ranjeet
 
Posts: 3
Joined: Wed Aug 17, 2011 7:01 am

Postby james.billings » Thu Aug 18, 2011 1:59 pm

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
james.billings
 
Posts: 1144
Joined: Wed Jun 16, 2010 11:10 am
Location: My desk.

Postby ranjeet » Fri Aug 19, 2011 6:10 am

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.
ranjeet
 
Posts: 3
Joined: Wed Aug 17, 2011 7:01 am

Postby james.billings » Fri Aug 19, 2011 7:58 am

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.
james.billings
 
Posts: 1144
Joined: Wed Jun 16, 2010 11:10 am
Location: My desk.

Postby ranjeet » Fri Aug 19, 2011 8:14 am

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
ranjeet
 
Posts: 3
Joined: Wed Aug 17, 2011 7:01 am

Postby james.billings » Fri Aug 19, 2011 10:44 am

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.
james.billings
 
Posts: 1144
Joined: Wed Jun 16, 2010 11:10 am
Location: My desk.


Return to SQL Data Generator 1

Who is online

Users browsing this forum: No registered users and 0 guests