Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a table right now that is set up up in the following way:
SurveysTable:
SurveyID Comment Positive Negative
32 good job 1 0
84 bad job 0 1
247 way to go 1 0
... ....
I'd like to create a list box or a straight table that will show 10 randomly picked comments from this table.
Thanks in advance,
Paulo
But it selects 10% of the records.
To select exactly 10, I create in the script a new field :
Rand() as U
Then in a chart or list, I can select the 10 biggest or lowest value of U ( using rank function)
JJJ
Hello Paulo,
You can create a sample table so you get some values to show, for example
SAMPLE 0.10 LOAD SurveyID AS SampleSurveyID, Comment AS SampleComment RESIDENT SurveysTable;
By adjusting that 0.10 you will narrow your results down.
Hope that helps.
But it selects 10% of the records.
To select exactly 10, I create in the script a new field :
Rand() as U
Then in a chart or list, I can select the 10 biggest or lowest value of U ( using rank function)
JJJ
Jean-Jacques,
That is exactly what I ended up doing. It's a different way to think about generating random records, but it works just fine for my purposes, and it is in fact still random.
In my mind, I was trying to go through a loop that would choose 10 random RowNumbers and load those records into another table. The SAMPLE method is actually useful as well, but like I mentioned, I wanted a very specific number of records. I'll definitely keep that method in mind tho.
Thanks for the suggestions guys, if anyone has any other ideas just let me know.