Ok. That is helpful.
The user has on their screen a table field with N rows in it. And you
want a way to "select" (randomly) some sub set of those rows.
First a discussion about random selection definition then later a
"how" to do this in the ARS clients.
Randomly could be used as follows:
When the user specifies the "number" they want to audit, you could use
the last digit of the "seconds" to be a "random seed" to the selection
process. Let us call that number "now_single_second". Keep that in a
temp field.
Then loop over the table and grab the records that have a modified
date that ends in that same digit until you reach the "number" they
wanted.
If you finish that pass through the table and still do not have enough
records, then loop through the table and grab every record that is the
"now_single_second" record in the table.
If you finish that pass through the table and still do not have enough
records, then reset "now_single_second" (or just add/subtract one to
the existing value) and loop through the table and grab every record
that is the "now_single_second" record in the table.
How to do it in the clients.
Add a column to the table field that uses a "Display only field" from
the local form. When looping through the table and you "select" a row
set this columns value to "X". You can then use the COLCOUNT()
function to count the rows that are selected throughout the process.
Once you have all the rows marked in the display only field then those
rows can be later selected by using the "ROWCHANGED" keyword when you
walk the table again to do whatever the system/user needs to do for
those records.
I hope that gives you some ideas...
Just note that if the table field is refreshed that these "X" values
will be cleared, so do not do that. :)
--
Carey Matthew Black
Remedy Skilled Professional (RSP)
ARS = Action Request System(Remedy)
Solution = People + Process + Tools
Fast, Accurate, Cheap.... Pick two.
Never ascribe to malice, that which can be explained by incompetence.
On 8/14/06, 李坤 <[EMAIL PROTECTED]> wrote:
Thank you,carey
I am designing a Configuration Management program now.The customer want
to implement a audit function as follows.
First,The User search the CI from CMDB through some search conditiones.
The second, he set the number of the CI that he want to audit,then the
system random get those form searching rusult of the first step.
The problem that I have no idea to implement the random getting.
[EMAIL PROTECTED]
2006-08-14
----- Original Message -----
From: Carey Matthew Black
To: arslist
Sent: 2006-08-14, 22:26:48
Subject: Re: How to random get 100 entries form a table list.
I have no exact suggestion for the stated question.
However, if you can describe what your going to use 100 random records
for then I might be able to provide some idea.
Most processes that require "random" input are for things like
Customer Satisfaction Surveys and other "data analysis" type
processes. And how you approach such functions are generally related
to why your doing what your doing.
Not to mention that "random" actually means different things depending
on what your doing too. (Random strings for password generation, PKI
key generation and Customer Satisfaction Surveys all have various
degrees of "randomness" that is needed.)
--
Carey Matthew Black
Remedy Skilled Professional (RSP)
ARS = Action Request System(Remedy)
Solution = People + Process + Tools
Fast, Accurate, Cheap.... Pick two.
Never ascribe to malice, that which can be explained by incompetence.
On 8/14/06, 李坤 <[EMAIL PROTECTED]> wrote:
>
>
> ARSLISTDear Listers,
>
> I am sorry to trouble you,there is some question with my work.
> How to random get 100 entry form a table list.
>
> Thanks a lot !
>
>
>
> [EMAIL PROTECTED]