Rule data sets
Rule Data Sets are used to define tables of allowable data, or valid combinations of codes, that SunSystems can refer to whilst data is entered.
For example, in Ledger Entry (LEN), you might want to restrict the Product codes allowed, depending on the specific Cost Centre entered. You can define a table of the valid combinations of Cost Centre and Product code in a Rule Data Set.
You can also configure SunSystems to 'insert' data, or force certain fields to take specific values whilst data is entered, by defining those specific values in Rule Data Presets.
Using Rule Data Sets
Rule Data Sets are used in conjunction with Rule Data Set Keys to maintain indexed lists of the valid combinations of selected data item values. These rule data sets are then used in rule sets as a simple method of referring to, and checking for, valid code combinations on the transactions being processed. Items in Rule Data Set Keys should be related to the same function.
A Rule Data Set comprises a list of predefined valid values for one, two or three key data items. The key data items are defined in the Rule Data Set Key. So, before you can identify the valid code combinations you must use Rule Data Set Keys (RDK) to identify the data items that make up the combination.
For example, you might want define the following valid Cost Centre/ Product code combinations for transaction entry, where the Cost Centre and Product codes are held in two separate ledger analysis dimensions:
Cost Centre | Product |
100 | P1 |
100 | P2 |
100 | P3 |
200 | P1 |
200 | P2 |
300 | P1 |
To set this up you must:
- Use Rule Data Set Keys (RDK) and select the ledger analysis dimensions that contain the Cost Centre and Product codes, as the key data items.
- Use Rule Data Sets (RDS) to define the valid cost centre and product code combinations listed above.
There are several reasons why you should use rule data sets to maintain code tables:
- they make the rule set simpler and therefore easier to understand and maintain
- they enable users to maintain the valid combinations without the need to understand rule sets
- they enable the same valid set of codes to be referenced on many different rule sets
- they increase the speed at which the rules execute.
For example, if you have a long list of account codes to which a rule applies and cannot use a masked value to identify them, you could define a large number of OR conditions within the rule set making it long and complex. Alternatively, you could define a rule data set that contains all of the values.
You can set an effective date and period range to a rule data set to limit it to a particular period of time. You can also reference the business unit code to create business unit specific combinations of data item values.
You can also use rule data sets that have a partially shared key to create nested levels of data combinations that are validated.
Referencing a Rule Data Set on a Rule Set
Once you have defined the valid code combinations in a rule data set you can reference them in a rule set. You use an IF condition statement and select the rule data set as Value 1. The keyword EXISTS is set automatically as Value 2 and is used to determine whether or not the current data record contains a valid code combination.
For example, assuming the valid combination of Cost Centre and Product codes has been defined in a Rule Data Set called CostCentre_Product, the following condition statement checks for a valid cost centre and product code combination:
Command | Value 1 | Operator | Value 2 |
IF | CostCentre_Product | EXISTS |
Rule Data Presets
Once a Rule Data Set has been created, you can configure SunSystems to 'insert' data, or force certain fields to take specific values whilst data is entered. You can define the specific values to be inserted using Rule Data Presets.
You can use Rule Data Presets to maintain up to twenty data item values for each rule data set code combination. These values can be used by the SET command in a rule set to preset the values of other data items automatically when a particular code combination is found.
Rule Data Presets provide a convenient and secure method of ensuring selected data items always contain the correct values in particular circumstances.
For example, for each Cost Centre/Product code combination referenced on a transaction, the Description and Ledger Analysis 5 data item values are preset as follows:
Rule Data Set Key/Values: Cost Centre | Rule Data Set Key/Values: Product | Rule Data Set Presets: Description | Rule Data Set Presets: Ledger Analysis 5 |
100 | P1 | Reg-A Grp-S | SFXP1100 |
100 | P2 | Reg-A Grp-T | SFXP2100 |
100 | P3 | Reg-A Grp-W | SFXP3100 |
200 | P1 | Reg-B Grp-S | SFXP1200 |
200 | P2 | Reg-B Grp-T | SFXP2200 |
300 | P1 | Reg-C Grp-S | SFXP1300 |
Rule Data Presets form the bottom level in a hierarchy with Rule Data Sets and Rule Data Set Keys, as shown in Hierarchy of Rule Data.