- Features by Edition
- Latest Features
- Licensing/Activation
- Installation
- Getting Started
- Data Sources
- Deployment/Publishing
- Server Topics
- Integration Topics
- Scaling/Performance
- Reference
- Specifications
- Video Tutorials and Reference
- Featured Videos
- Demos and screenshots
- Online Error Report
- Support
- Legal-Small Print
- Why Omniscope?
|
||||||
SUBSET functionsOmniscope SUBSET Functions (2.6+)This page describes the latest functionality available in Omniscope 2.6 b607 and later. If you are using 2.5 or an earlier version of 2.6, please see the older guide.
Defining formulae involving evaluated data subsetsSUBSET functions are unique to Omniscope and are broken down into two sub-classes of functions which work together:
Note: these replace the previous, now deprecated DATASET_... functions as they are more flexible and efficient. Other functions other than SUBSET_MEAN/SUM/etc. also use SUBSET 'clauses' such as RANK.
Warning: experimental functionsThe new INTERSECTION, UNION and INVERSE functions are classed as experimental because they have not been optimised for performance. If you find they perform too poorly for your data size, please continue to use the older SUBSET2 etc. functions documented here. Performance improvements are scheduled for 2.7.
Example: Combining SUBSET 'clause' with SUBSET_SUM to roll-up data
Examples of SUBSET 'clause' constructions:SUBSET 'clauses' results in a data subset for use in other functions (such as SUBSET_MEAN or RANK). You would not normally use the result of SUBSET 'clause' as the end result of the entire formula, since you cannot display the definition of the subset defined as a data table inside a cell. SUBSET 'clauses' are used to identify records by one constraint (e.g. Month is "February"). To identify records by multiple constraints, or use more complex logic, combine SUBSET with INTERSECTION, UNION and INVERSE (e.g. All of records in [Month is "February"] and [Client is "Acme Bank"]).
Examples of how you would use SUBSET: functionsSUBSET_... functions (such as SUBSET_MEAN) accept a field for the statistical function and an optional data subset 'clause' to restrict the record set.
Worked example - single field subsetThis example shows a table of data containing Traders and their Sales Volume by Country. We want to find out the total Sales Volume for each Trader.
The field "Formula field" above is defined with the formula:
Broken down, this means:
When Omniscope evaluates the first cell (60,000) in "Formula field":
Worked example - multi-field subsetsThis example involves a table of data containing multiple quotes for multiple parts to multiple clients in multiple currencies. We want to find the lowest Quote in "USD" for each combination of Part and Customer.
The formula field [Min USD Quote] above can be defined with the following formula:
Broken down, this formula means:
INTERSECTION(SUBSET([Customer]), SUBSET([Currency], "USD"), SUBSET([Part])) = all combinations of 'Customer' and 'Part' where Currency="USD" RANK function exampleThe RANK function works much like the Excel RANK function, and allows you to infer the RANK of a value within a set of values. In Omniscope, the value can be any literal value or the value of a referenced field. The set of values must be all values within a named field, either for all records, or for a data subset. Examples for the above Customer/Currency/Part/Quote/Min USD Quote data, where the Quote column has ordered values as follows:
So, when evaluating the formula for a record where Quote is 8:
The following is true for all record evaluations, since it uses a literal value:
CustomisationsBy default, RANK uses descending order, so larger values rank higher. To reverse this and use ascending order, provide a 3rd argument 'true'. For example:
RANK also allows you to choose whether to count nulls when generating the rank. By default nulls are ignored. RANK also allows you to provide a data subset, so you can customise the set of values considered.
|