how to create table in SSAS tabular cube in Visual Studio - ssas

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.

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.
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:

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.
In the formula bar, you can change the formula to = Table.FromRecords({},{"Column1"}):

Related

SSAS Tabular Model - Add column to existing table

I am using VS2019 for SSAS Tabular Model development. Have imported a table from a CSV. The source CSV has undergone a change(new column has been added). When I process my table in VS2019, it gets processed successfully. However I am unable to see the new column introduced in source CSV. I went to Table properties and did a Refresh Preview but was not able to see the new column. Closed and re-started solution, re-processed the table but no luck! I remember in VS2017 we used to add the column by going into table properties and selecting the new column but things seem to be different in VS2019. Any help would be appreciated.
I'm assuming you used Get Data / Power Query to import the CSV. This unfortunately generates a Power Query Csv.Document function call that includes the number of columns when the query was generated. This parameter isn't exposed through the usual Power Query UI.
If you use the Advanced Editor or turn on the Formula Bar (view menu), you will see a parameter like Columns=10, was generated, usually in your Source step.
It currently seems safe to delete that parameter by editing the code - it will then always pull back all columns presented. Or if you prefer, you can edit the number of columns, as described in this blog post:
https://prathy.com/2016/08/how-to-add-extra-columns-to-an-existing-power-bi-file-which-using-csv-data-source/

locate values in report filter in excel 2007 connecting a SSAS 2005 database

I created a pivot table in excel 2007 from a SSAS (2005) database. I have a product dimension, which has too many items. When I put it in report filter, I can either select all or go through all the items in it until I find the one I want. Is there a better way to do it? E.g. I enter xxx, then find all the items begins with the xxx.
All right, I figure it out it can be done by not put the product in report filer, instead put it in rows (or columns). Then right click on it and choose filter - label filter, where I can enter the product name.

Dimension Attribute not showing up in Business Intelligence Dev Studio

So I have a database schema and now I need to create a Cube for Analysis Services. I am, however, having an issue with one of the columns.
Here is what I did:
1. Create the Data Source
2. Create the Data Source View
3. Create dimensions, and this is where the problem is...
So my database has 10 tables and most of them work fine except for one. One table 'CustomerSatisfaction' has the columns 'year' 'quarter' 'customerSatisfactionValue' and 'productID'. Now when I create dimensions from this table I can't see the 'quater' column.
Basically I use the create dimension wizard but on the 'Select Dimension Attributes' section of the wizard I can't see the 'quarter' column. Any ideas why this is? I really want 'quarter' to be an attribute but it doesn't seem to be working...
Thanks for any help!
Is quarter listed as a column in the data source view?
If so, open up the dimension designer and drag the attribute from the data source view (on the right) to the attribute list (left).
If not, you'll need to fix the dimension query / refresh the table column listing in the data source view.

How to update the Dataset to reflect an added column in the data source without deleting the adapter?

I've made a dataset using the dataset designer, and I'm trying to add a column to reflect changes made to the database (added a column, nothing fancy). Is there a way to 'refresh' the dataset schema from the datasource without deleting my adapter (and all the methods and queries I've created)?
I know its been a while since you posted but as I was having the same problem and figured out how to do this I reckoned I'll post the solution that worked for me.
Right click on the dataset object you want to update (on the strip at the bottom of your viewpane)
Select "Edit in Dataset Designer"
in the dataset designer, right click on the header of the table you want to add a column to
select configure... this will bring up the sql statement that is used to draw values into the dataset for this table
Edit the sql to include the column you want to include in your dataset's table and click finish i.e. in the select statement, include your columns name in the list
close the dataset designer then go to any controls (in my case its a datagridview), click on the tasks arrow (top right hand corner next to the handle) and select add column
select the newly created column from the list of databound columns and click "add"
select "edit columns" from the task menu
move the column to the correct position (it will always be placed as the last column in your grid and you may not want it to be the last column)
voila, I know its hardly snappy but it beats the hell out of deleting the dataset and then fixing up all the coding errors that come up... also after doing it a few times it'll be like second nature (I hope)
regards
p.s. am working in VS2010
Had to just delete the adapter and the table. It's rather annoying but I guess there really isn't a way around it. Maybe in VS2010 or later versions of .net.

Pentaho Report Designer: How to create a chart based on an OLAP cube?

Using Pentaho Report Designer, I can successfully display my OLAP cube's data as a table.
But when I want to display the same data as a chart, it always fail saying "CHART.USER_NO_DATA_AVAILABLE".
Actually, I don't really know what I should enter for category-column and value-columns. I tried:
category-column = [Area].[prefecture]
value-columns = [[Product].[Product.Product].[All Products].[productA]]
And any other variation I could think of, but no success. Any idea? Thanks!
My OLAP cube is a Pentaho Analysis: sales count for each product and prefecture.
Just use:
[Product].[Product.Product].[All Products].[productA]
You only need the extra square brackets around the entire fieldname if it's a formula.
Or pick the field from the dropdown.. then you know you have the right one!
If you're doing a timeseries xy, note you have to repeat the category column value as many times as the value column.
also make sure you have a series name too.