Home > Class Reference > %SYS namespace > %iKnow.Filters.RandomFilter


class %iKnow.Filters.RandomFilter extends %iKnow.Filters.Filter

This filter randomly selects a percentage of the existing sources in the current domain, to be used for analysis or query testing.

Filter parameters:

  1. pDomainId As %Integer
  2. pDelect As %Numeric - if this is a value between 0 and 1, it is interpreted as the desired selectivity of the filter or the share of the total number of sources to select. If this value is >= 1, it is considered to be the desired number of sources to select (rounded down). If this value is larger than the total number of sources in this domain, all sources are selected.
  3. pSelectFrom As %iKnow.Filters.Filter - if set to a valid filter object or string representation, the randomly selected sources are selected from this set only. If select refers to a fraction, the fraction is calculated based on the total number of sources filtered by selectFrom as if it were "the full domain" to select from.

Property Inventory (Including Private)

Method Inventory (Including Private)

Properties (Including Private)

property ReqSelectivity as %Integer [ Private ];
Property methods: ReqSelectivityDisplayToLogical(), ReqSelectivityGet(), ReqSelectivityIsValid(), ReqSelectivityLogicalToDisplay(), ReqSelectivityNormalize(), ReqSelectivitySet()
property SelectFrom as %iKnow.Filters.Filter [ Private ];
Property methods: SelectFromGet(), SelectFromGetSwizzled(), SelectFromIsValid(), SelectFromNewObject(), SelectFromSet()

Methods (Including Private)

private method %OnNew(pDomainId As %Integer, pSelect As %Numeric = 0.1, pSelectFrom As %iKnow.Filters.Filter = "") as %Status [ Language = objectscript ]
Inherited description: This callback method is invoked by the %New() method to provide notification that a new instance of an object is being created.

If this method returns an error then the object will not be created.

It is passed the arguments provided in the %New call. When customizing this method, override the arguments with whatever variables and types you expect to receive from %New(). For example, if you're going to call %New, passing 2 arguments, %OnNew's signature could be:

Method %OnNew(dob as %Date = "", name as %Name = "") as %Status If instead of returning a %Status code this returns an oref and this oref is a subclass of the current class then this oref will be the one returned to the caller of %New method.

private method BuildSourceFilter(maxOffset As %Integer) as %Status [ Language = objectscript ]
private classmethod RestoreFilterFromStringInternal(filterParams As %String) as %iKnow.Filters.Filter [ Language = objectscript ]
Inherited description:

Default implementation, with the filterParams corresponding to all %New() arguments. See also RestoreFilterFromString().

method ToString() as %String [ Language = objectscript ]
Inherited description:

Subclasses should implement this method to build a string representation of the filter instance. It should start with the filter class name, followed by a pipe (|) character and then a string representation that can be interpreted by its RestoreFilterFromStringInternal() implementation.

Inherited Members

Inherited Properties (Including Private)

Inherited Methods (Including Private)