相同事实表列;多种原因记录

发布于 2024-11-14 00:03:08 字数 249 浏览 3 评论 0原文

我的情况类似于下面的情况:

例如,我们需要将客户销售存储在事实表中(在使用维度建模构建的数据仓库下)。我要存储销售、与销售相关的折扣、销售退货和取消。

您认为将某一特定产品(当该天是谷物时)客户一天的销售额存储为正值,而将退货和折扣存储为负值是否明智?

此外,如果在产品以外的级别(例如品牌)对客户强制执行折扣,您认为可以使用专门分配给品牌的键(产品是谷物)来保留折扣,而产品列是对于特定记录,给出 N/A?

提前致谢。

I am in a situation similar to the one below:

Think for instance we need to store customer sales in a fact table (under a data warehouse built with dimensional modelling). I have sales, discounts related to the sale, sales returns and cancellations to be stored.

Do you think it would be advisable to store sales for a day to a customer in a particular product (when the day is the grain) as a positive value while the returns and discounts are stored as minuses?

Also if a discount is enforced to a customer at a level other than the product (for instance brand), do you think it is alright to persist it with a key particularly assigned to the brand (product is the grain) while the product column being given an N/A, for the particular record?

Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

凝望流年 2024-11-21 00:03:08

如果您的销售额被认为是一件好事(我假设是这样),那么将销售额记录为正数就非常有意义。因此,任何减少销售额的交易(即折扣和退货)都应记录为负数。这将使报告您的销售额变得非常自然。

如果您有可能占记录的不同维度,则应填充有意义的维度。因此,是的,如果您的业务交易中发生了这种情况,请将折扣归因于品牌而不是产品。这样,您的报告将能够查看所有折扣、特定产品的折扣以及整个品牌的折扣。如果您的事实表显示了折扣的最直接“原因”(产品或品牌),那么您的报告将比通过与产品的关系将事实与品牌联系起来更有用。

If your sales are considered a good thing (I'm assuming they are) then recording sales as positive numbers makes perfect sense. Any transaction that reduces sales (i.e. discounts and returns) should therefore be recorded as negative numbers. This will make reporting your sales very natural.

If you have diffent dimensions that might account for a record, you should populate the dimensions that make sense. So yes, attribute a discount to a brand rather than a product if that is what happened in your business transaction. This way your reporting will be able to look at all discounts, at discounts for particular products and discounts for entire brands. If your fact table shows the most direct "cause" of the discount (product or brand) then your reports will be more useful than if you link the fact to brand through a relationship to product.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文