在 SSAS 中跨内联计算成员保留语言

发布于 2024-08-25 07:42:23 字数 868 浏览 4 评论 0原文

问题:我需要从多维数据集中检索给定单元格的语言。该单元由代码生成的 MDX 定义,就计算成员和集合而言(在 WITH 子句中定义),它可以具有任意级别的间接性。当您在查询中声明内联计算成员时,SSAS 似乎会忽略指定成员的语言。

示例:

  • 多维数据集的默认区域设置为 1033 (en-US)
  • 该多维数据集包含名为 [Net Pounds] 的计算度量,其定义为 [Net Amt], language=2057 (en-GB)
  • 查询请求此度量值以及内联计算度量值,该度量值只是 [Net Pounds] 的别名。
  • 直接使用时,该度量值采用 en-GB 语言环境进行格式化,但是当如果有别名,该度量将回退到使用多维数据集默认值 en-US。

查询如下所示:

WITH MEMBER [Measures].[Pounds Indirect] AS [Measures].[Net Pounds]
SELECT { [Measures].[Pounds Indirect], [Measures].[Net Pounds] } ON AXIS (0)
FROM [Cube] CELL PROPERTIES language, value, formatted_value

查询返回预期的两个单元格,但在直接使用时仅使用 [Net Pounds] 区域设置。

SSAS 中是否有某个选项或开关允许区域设置信息在计算成员中可见?我意识到可以在特定区域设置中声明内联计算成员,但这将涉及首先从元组中提取区域设置,而该区域设置(因为多维数据集的成员在应用程序的查询架构中是隔离的)是未知的。

Problem: I need to retrieve the language of a given cell from the cube. The cell is defined by code-generated MDX, which can have an arbitrary level of indirection as far as calculated members and sets go (defined in the WITH clause). SSAS appears to ignore the Language of the specified members when you declare a calculated member inline in the query.

Example:

  • The cube's default locale is 1033 (en-US)
  • The cube contains a Calculated Measure called [Net Pounds] which is defined as [Net Amt], language=2057 (en-GB)
  • The query requests this measure alongside an inline calculated measure which is simply an alias to the [Net Pounds]
  • When used directly, the measure is formatted in the en-GB locale, but when aliased, the measure falls back to using the cube default of en-US.

Here's what the query looks like:

WITH MEMBER [Measures].[Pounds Indirect] AS [Measures].[Net Pounds]
SELECT { [Measures].[Pounds Indirect], [Measures].[Net Pounds] } ON AXIS (0)
FROM [Cube] CELL PROPERTIES language, value, formatted_value

The query returns the expected two cells, but only uses the [Net Pounds] locale when used directly.

Is there an option or switch somewhere in SSAS that will allow locale information to be visible in calculated members? I realise that it is possible to declare the inline calculated member in a particular locale, but this would involve extracting the locale from the tuple first, which (since the cube's member is isolated in the application's query schema) is unknown.

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

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

发布评论

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

评论(3

や莫失莫忘 2024-09-01 07:42:40

事实证明这里没有好的解决方案。在查询中声明计算成员时,必须指定区域设置,否则默认为多维数据集的区域设置。显然,这就是规则。

Turns out there's no good solution here. When declaring a calculated member in the query, the locale must be specified, otherwise it is defaulted to the cube's locale. Them's the rules, apparently.

入怼 2024-09-01 07:42:35

通常,仅当翻译将标题列绑定到数据源时,区域设置信息才可用,您的示例是否属于这种情况?

Generally the locale information is only available if the translation has the caption column bound to the data source, is this the case for your example?

携君以终年 2024-09-01 07:42:30

MEMBER [Measures].[Category] AS [Dim Category].[Category Parent ID].CURRENTMEMBER.Properties("LCID1036")
MEMBER [Measures].[Survey Date] AS [Dim Survey Date].[Hierarchy].CURRENTMEMBER.Properties("LCID1036")

SELECT 
NON EMPTY{[Measures].[AVG MFA Score], [Measures].[CategoryIsLeaf], [Measures].[Category], [Measures].[Survey Date]} ON COLUMNS, 

NON EMPTY { filter((DESCENDANTS(STRTOSET("[Dim Survey Date].[Hierarchy].members"),[Dim Survey Date].[Hierarchy].[Month],SELF), STRTOSET("[Dim Category].[Category Parent ID].members")),[Measures].[AVG MFA Score]<>null)}

DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS 
from [MFA DWH]

WITH

MEMBER [Measures].[Category] AS [Dim Category].[Category Parent ID].CURRENTMEMBER.Properties("LCID1036")
MEMBER [Measures].[Survey Date] AS [Dim Survey Date].[Hierarchy].CURRENTMEMBER.Properties("LCID1036")

SELECT 
NON EMPTY{[Measures].[AVG MFA Score], [Measures].[CategoryIsLeaf], [Measures].[Category], [Measures].[Survey Date]} ON COLUMNS, 

NON EMPTY { filter((DESCENDANTS(STRTOSET("[Dim Survey Date].[Hierarchy].members"),[Dim Survey Date].[Hierarchy].[Month],SELF), STRTOSET("[Dim Category].[Category Parent ID].members")),[Measures].[AVG MFA Score]<>null)}

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