Re: Stuck Up In My Category Tree

From: Brent Dombrowski <brent(dot)dombrowski(at)gmail(dot)com>
To: Don Parris <parrisdc(at)gmail(dot)com>, pgsql-novice(at)postgresql(dot)org
Subject: Re: Stuck Up In My Category Tree
Date: 2011-08-23 18:34:53
Message-ID: 309CF61A-2B4D-40CE-A120-DED4787A0534@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice


On Aug 23, 2011, at 11:17 AM, Don Parris wrote:

> On Wed, Aug 17, 2011 at 19:31, Don Parris <parrisdc(at)gmail(dot)com> wrote:
>> I now have a work-around. I have a view called amntby_cat that contains
> the sums by category, which I pull into a LibreOffice Calc sheet. I then
> use a second sheet with a list of the top-level categories, and a series of
> formulas to sum all the sub-categories for each top-level category,
>
> I am now curious as to how business accounting databases approach
> transaction categories? If I am selling widgets to all 7 continents (as i
> learned them), I might have sales as follows:

An approach I've seen before is to encode things into a department id. All North American departments start with 1, etc. The rollups are then done by truncating the id down to the granularity required. At least this was the approach my previous employer took. They were more interested in particular customers, so the encoding was based on that. This was on a relatively small scale basis (~500 employees and few enough customers to count by hand). I'm not sure how well that would scale. It definitely takes some planning and forethought.

Brent D.

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message ennio 2011-08-24 15:33:54 Re: Data corruption after an update set ...?
Previous Message Don Parris 2011-08-23 18:17:00 Re: Stuck Up In My Category Tree