Simple Hierarchies - Example Scripts

The examples in the script below show the simple ancestor-descendent traversal queries such as finding the ancestors or descendents of a node. It also shows the rollup of transactions by the account hierarchy. The last query does the same thing but instead of explicitly doing the between-join in the query, it uses a view that hides this complexity.

Notice that the posting nodes of the account hierarchy have a PostSign attribute that determines whether to negate the transaction amount in order to make expenses always negative and revenue always positive.

AttachmentSize
SimpleRollup.sql653 bytes
VDM Access: