SSAS / MDX / ADOMD.NET - 从多维数据集检索上次更新日期
我正在尝试从多维数据集检索上次更新日期。我有一个每天运行两次的进程(最终我希望它能够通过单击按钮来执行,但那是更进一步的事情)。我对这一切都很陌生。
因此,现在我只想通过 MDX 查询检索该进程上次运行时间的日期时间值。
这是我的连接字符串:
public AdomdConnection conn = new AdomdConnection("Data Source=BTN-SQL1;Initial Catalog=BTNTurboAnalysisServices;");
该进程称为: Process SSAS
然后我已经走到这一步了,但我不知道在我的 MDX 查询中要写什么:
conn.Open();
AdomdCommand cmd = conn.CreateCommand();
cmd.CommandText = @"
SELECT
NON EMPTY { [] } ON COLUMNS,
{ [] } ON ROWS
FROM [Sales Analysis]
";
任何帮助将不胜感激,谢谢!
I'm trying to retrieve the last updated date from a cube. I have a process that runs twice a day (eventually I would like it to be able to be executed at a click of a button but thats further down the line). I'm quite new to all of this.
So for now I'd just like to retrieve a datetime value through an MDX query of when that process was last run.
Here is my connection string:
public AdomdConnection conn = new AdomdConnection("Data Source=BTN-SQL1;Initial Catalog=BTNTurboAnalysisServices;");
The process is called: Process SSAS
Then I've got this far, but I dont know what to write in my MDX query:
conn.Open();
AdomdCommand cmd = conn.CreateCommand();
cmd.CommandText = @"
SELECT
NON EMPTY { [] } ON COLUMNS,
{ [] } ON ROWS
FROM [Sales Analysis]
";
Any help would be appreciated, thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用架构来获取该信息。
我使用的是 ADODB 对象,但您可以找到相应的 ADOMD 对象。
抱歉...答案错误...
尝试使用 LASTSIBLING 函数:
选择
{[措施].[互联网销售额]} 在列上,
{[日期].[财政].[财政年度].&[2002].LASTSIBLING} 在行上
来自【冒险作品】
You could use the schema to get that information.
I'm using ADODB objects, but you can find the corresponding ADOMD objects.
Sorry... wrong answer...
Try with the LASTSIBLING function:
Select
{[Measures].[Internet Sales Amount]} On Columns,
{[Date].[Fiscal].[Fiscal Year].&[2002].LASTSIBLING} On Rows
From [Adventure Works]