使用 MDX 获取非空值的最后日期

发布于 2024-12-22 05:07:50 字数 162 浏览 2 评论 0原文

您知道如何使用 mdx 查询获取最后一个非空值吗?然后在那之后……我想计算截至最后日期为止它旁边有多少个空值。我这样做的主要目的是计算客户有多少天没有交易。

我必须在 ssrs 中制作一份报告(使用 Adventure Works Cube)来计算客户有多少天没有交易。

谢谢。

Do you know how to get the last non-empty value using mdx query.. then after that.. i want to count how many null values are next to it up to the last date. My main purpose for this is to count how many days a customer has no transaction..

i have to make a report in ssrs (using adventure works cube) that counts how many days a customer has no transaction..

thanks..

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

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

发布评论

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

评论(2

蝶舞 2024-12-29 05:07:50

使用本文获取一组非空日期。

要获得计数,您可以:

  1. 使用成员属性(一年中的某天或更适合的内容)
    在这种情况下),只需从一个值中减去另一个值即可。
  2. 你可以找到
    最后一个日期为非空值,前一个日期使用 LAG(1),包括
    它们到下一个构造 {prev.date:last.date} 并使用 COUNT
    对于集合

Use this article to obtain set of non empty dates.

To obtain count you can:

  1. Use member properties (day of year or something more suitable in
    this case) and just subtract one value from another.
  2. You can find
    last date with non empty value, previous one using LAG(1), include
    them to the next construction {prev.date:last.date} and use COUNT
    for set
笑梦风尘 2024-12-29 05:07:50

最近我关注这个文章,这确实对我有帮助。
最重要的部分是了解范围的用法。
即使您没有企业版,您也可以使用它。

Recently I follow this article, It really helps me.
The most important part is to understand scope usage.
Even If you don't have an Enterprise Edition, you can use it.

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