Expressions Hierarchy
What is Expressions hierarchy
Many tables in Baan contain certain values which if converted into some other values by Baan expressions, forms good hierarchical structures. For technical audience, these expressions are the once which can be compiled using expr.compile function in Baan.As you read the examples of hierarchies, it will be clearly evident how useful are expression hierarchy and how easily they can be generated.
Session Description
Fields
1. Hierarchy – It’s is the 9 character code in ERPJewels system by which any hierarchy is recognized. This hierarchy code is used while editing hierarchies and linking the same to analyses.
2. Update Mode - The hierarchy generation mode can be Append / Rewrite. Append update mode can be useful when the master data are dynamic and user wants to update only new data. With rewrite mode , the hierarchies will be completely overwritten.
3. Description – 30 character description which is descriptive of hierarchy in functional terms.
4. Table name – It is the Baan table name around which the hierarchy revolves.
5. Expressions – It is valid Baan expression made of valid table field . It can be string concatenation or substrings of any alphanumeric Baan table field or any numerical expressions among numeric table fields. These expressions can be 150 characters long. Fields of other tables which share same primary key with main table can also be specified here.
6. Description – It is the hierarchy level description. For an expression which is valid Baan table field, the table field description is the default descriptions.
7. Field Domain – For an expression which is valid Baan table field, the table field domain is the default domain. Alternatively the user can enter any valid Baan domain to which expressions returned string will be converted and aligned.
8. Description Field – This is any Baan table field which contains description of the expression. If the expression is a table field and it has reference to some other table, any 30 character plus length field of the reference table is defaulted as the description of the expression. This has to be valid Baan table field.
9 . Condition Field – This is the table field of the table on which expression hierarchy is generated. This is to be filled when the user wish to restrict the hierarchy generation only to certain records of the table based on the value in this field. Text and combined fields are not allowed. Text and combined fields are not allowed in this field.
10. Operator – All operators for which singular operands exists are allowed here like equal to , greater than, less than , like , not like etc. For string and multibyte field , like and not like can be selected from enum options.
11.Value – This is the value of the field to which the hierarchy generation is restricted. Value is aligned according to domain. For numeric domains only numbers are allowed. For enum/set fields only valid options can be selected.
Session Logic
The session selects the records from the table depending on the selection criteria. If possible it uses the table index also in order to speed up hierarchy generation. It aligns the returned information according the domain specified and then it gets the descriptions from the reference table and updates the same hierarchies’ masters.
The session can also be run in job mode to update hierarchy just before the analyses (linked to hierarchies) are run in job.
Example of Hierarchy Based on Item Master (Expression Hierarchies)
NOTES
1.Items with 8 characters in Item master denote special category of items , say Diamonds.
2. And diamonds can be classified in categories as defined from 1st to last level. And it forms a hierarchy from top to bottom.
3.Any string concatenations & substrings can be used. For numeric fields, any valid arithmetic expression can also be used.
4.Description is hierarchy level description.
5. If expression is by default the valid table column then the column domain is the default domain for that field. With the help of these domains only the hierarchy data comparison with transactional data is possible. Further this domain is useful while editing hierarchies manually.
6. Description fields are the descriptions of hierarchy field codes if it is valid table column. Any column with more than 29 characters in the reference table is defaulted here. These descriptions are stored in hierarchy tables and are available while editing the same manually. Further an option is available to have the hierarchy descriptions instead of code to be available in analyses results to make it more meaningful.
NOTES
1. Even fields of other tables (table tijwx984 in the example above) which share the same indices as hierarchy table (tiitm001) can also maintained.
2. Domain field and description field can be left blank. If the description field is blank then the description is same as hierarchy code itself.
Example of Hierarchy based on Fiscal Periods
NOTES
1. Table tfgld005 is taken as base for generating time hierarchy contained within it.
2. In our case, there are 12 periods corresponding to calendar month forms part of the fiscal year.
3. By a condition, hierarchy generation is restricted to fiscal period only.
4. By use of expressions which can be valued in Baan , the half year and quarters are brought into hierarchy.
The complete expressions are as follows.
i. For Quarters (like Q2002-1) ŕ "Q" & str(tfgld005.year)&"-"&str
(int((tfgld005.prno-1)/3)+1)
ii. For Half Year (like H2002-1) ŕ "H" & str(tfgld005.year)&"-"& str
(int((tfgld005.prno-1)/6)+1)
Fields of the same table can be used as descriptions. (tfgld005.desc)
FastTrack to ERPJEWELS :
Latest Trend | Hot Links | Jewels of ERPJewels | Jewels of Baan | Jewels of Excel