Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm creating data for a demo and trying to generate a Yes or No entry during a load into a bunch of fields in a LOAD. Is there any way do this using rand() or another function? Ideally, I'd like to not have an even distribution of Y/N if that's possible. Thanks!
Yes, you can do it using RAND() function:
LOAD
if( RAND() < 0.3, 'Yes','No') as Answer,
Recno() as AnswerID
Autogenerate 1000;
edit: This creates a 30% chance for a Yes answer (using 0.3). Just compare to different values between 0 and 1 to create other distributions.
Yes, you can do it using RAND() function:
LOAD
if( RAND() < 0.3, 'Yes','No') as Answer,
Recno() as AnswerID
Autogenerate 1000;
edit: This creates a 30% chance for a Yes answer (using 0.3). Just compare to different values between 0 and 1 to create other distributions.
Thanks 'swuehl' - that was exactly what I was looking for!