如何在 Visual Studio 中的 SSAS 表格多维数据集中创建表

发布于 2025-01-11 19:16:15 字数 137 浏览 3 评论 0原文

如何在 SSAS 表格多维数据集中创建空表?我不希望这个空表成为计算表。而且,我不想从 SQL Server 导入空表。我正在使用 Visual Studio 2019,并安装了 Microsoft Analysis Services Projects 扩展。

How can I create an empty table in a SSAS tabular cube? I don't want this empty table to be a calculated table. And, I don't want to import an empty table from SQL Server. I'm working in Visual Studio 2019, with the Microsoft Analysis Services Projects extension installed.

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

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

发布评论

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

评论(2

森末i 2025-01-18 19:16:16

在 Power Query 中提取数据,然后删除所有行,然后删除所有列。这是使用我的日期维度的示例。

let
    Source=#"CSV Calendar csv",
    #"Filtered Rows" = Table.SelectRows(Source, each [DateKey] = #date(1111, 1, 1)),
    #"Removed Columns" = Table.RemoveColumns(#"Filtered Rows",{"DateKey", "DateInt", "YearKey", "QuarterOfYear", "MonthOfYear", "DayOfMonth", "MonthName", "MonthInCalendar", "QuarterInCalendar", "DayOfWeekName", "DayInWeek", "MonthYear", "SortColumn", "AcctWorkDays", "HolidayWorkday"})
in
    #"Removed Columns"

如果您使用 Visual Studio 作为模型,这是一个坏主意。您无法添加度量,也无法更新它们(如果存在)。网格中的蓝色选定单元格位于“添加列”列中,不可编辑。

VS2019, grid 不可编辑

我知道在此表上获取度量的唯一方法是添加一列以启用网格,然后您可以添加一个度量,然后可以删除该列。这一切都有效,但后来我收到了显示的消息:

Visual Studio 2019

Pull in data in Power Query, then remove all rows then all columns. Here's an example using my date dimension.

let
    Source=#"CSV Calendar csv",
    #"Filtered Rows" = Table.SelectRows(Source, each [DateKey] = #date(1111, 1, 1)),
    #"Removed Columns" = Table.RemoveColumns(#"Filtered Rows",{"DateKey", "DateInt", "YearKey", "QuarterOfYear", "MonthOfYear", "DayOfMonth", "MonthName", "MonthInCalendar", "QuarterInCalendar", "DayOfWeekName", "DayInWeek", "MonthYear", "SortColumn", "AcctWorkDays", "HolidayWorkday"})
in
    #"Removed Columns"

It's a bad idea if you are using Visual Studio for the model. You can't add measures, nor update them if they are there. The blue selected cell in the grid is in the "Add Column" column and is not editable.

VS2019, grid not editable

The only way I know to get a measure on this table is to add a column to enable the grid, then you can add a measure, and then you can delete the column. That all works, but then I got the displayed message:

Visual Studio 2019

绅士风度i 2025-01-18 19:16:16

我想这可能就是您正在寻找的。据我所知,您至少需要一个现有的数据源来添加一张表,但随后该表不需要引用它。在此示例中,我刚刚添加了一个本地文本文件。然后右键单击它并选择导入新表。这将弹出指向数据源的 Power Query。
导入文本file

在公式栏中,您可以将公式更改为 = Table.FromRecords({},{"Column1"})
公式

I think this might be what you're looking for. As far as I know, you need at least one existing DataSource to add a table, but then the table doesn't need to refer to it. In this example, I just added a local text file. Then right click it and and choose Import New Tables. This will pop open Power Query pointed at the DataSource.
Import text file

In the formula bar, you can change the formula to = Table.FromRecords({},{"Column1"}):
Formula

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