axapta2009:在特定日期对 inventtrans 求和,按维度过滤

发布于 2024-10-29 20:24:19 字数 573 浏览 1 评论 0原文

我需要计算在特定日期具有特定物理尺寸 [inventTransPosting.Dimension] 的 InvnetTrans 的总和。即我需要类似的

select sum(CostAmountPosted) //other sums
     from InventTrans 
     where  InventTrans.transDate  < 3\3\2010
exists join InventTransPosted 
    where InventTransPosted.dimension[1] == 'XXX'
       && InventTransPosted.inventTransId == inventTrans.inventTransId
       && //other relations

可以使用 InventSum* 类通过 InventDim 过滤 InvenTranses 来计算 InvenTrans 总和。 是否可以通过非发明维度进行过滤? 或者是否有必要更改 InventSum* 类? 现在我没有看到 inventSum* 类可以按维度过滤。也许我错过了一些课程?

I need to calculate sum of InvnetTrans'es that have specific physicial dimensions[inventTransPosting.Dimension] on specific date. I.e. I need analogue of

select sum(CostAmountPosted) //other sums
     from InventTrans 
     where  InventTrans.transDate  < 3\3\2010
exists join InventTransPosted 
    where InventTransPosted.dimension[1] == 'XXX'
       && InventTransPosted.inventTransId == inventTrans.inventTransId
       && //other relations

It is possible to calculate InvenTrans sum with InventSum* classes filtering InvenTranses by InventDim.
Is it possible somehow to filter by non inventdim dimensions?
Or it is neccessary to change InventSum* classes?
Right now I don't see that inventSum* classes can filter by Dimensions. Maybe I missed some classes?

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

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

发布评论

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

评论(3

风尘浪孓 2024-11-05 20:24:19

重构您的选择:

select sum(CostAmountPosted) //other sums
     from InventTrans 
exists join InventTransPosting
    where InventTransPosting.dimension[1] == 'XXX'
       && InventTransPosting.transDate  < 3\3\2010
       && InventTransPosting.inventTransId == inventTrans.inventTransId
       && InventTransPosting.itemId == inventTrans.itemId
       && //other relations

在 InventTransPosting 上创建相关索引,将 Dimension[1] 作为第一个索引字段,将 TransDate 作为第二个索引字段。

Restructure your select:

select sum(CostAmountPosted) //other sums
     from InventTrans 
exists join InventTransPosting
    where InventTransPosting.dimension[1] == 'XXX'
       && InventTransPosting.transDate  < 3\3\2010
       && InventTransPosting.inventTransId == inventTrans.inventTransId
       && InventTransPosting.itemId == inventTrans.itemId
       && //other relations

Make relevant index on InventTransPosting with Dimension[1] as first index field and TransDate as second.

云巢 2024-11-05 20:24:19

看一下 InventOnHand 类。

它根据项目 ID 和库存维度(但不是财务维度)等标准对现有发明值进行求和。

InventOnhand 有多种构造函数方法可以将 new 命名为 newInventBatch

Take a look on the InventOnHand class.

It sums the invent on-hand values based on criteria like item id and inventory dimensions (but not financial dimensions).

There are several constructor methods to InventOnhand name new like newInventBatch.

北城半夏 2024-11-05 20:24:19

您可以在 InventTransPosted 表上冗余存储 amountPosted,然后创建相关索引。

在现有交易上填充 amountPosted 可能会出现问题。

值得吗?
或者您可以使用 BI 工具来制作报告吗?

You could store - redundantly - amountPosted on InventTransPosted table, then make a relevant index.

The filling of the amountPosted on existing transaction may be problematic.

Is it worth it?
Or could you use a BI tool to do your report?

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