how to create table to hold measures in SSAS tabular cube - ssas-tabular

I want to create an empty table in a SSAS tabular cube (in SSDT, in Visual Studio) to hold all of my cube's measures. In Power BI Desktop, I would do so by creating a 1-column "empty" table in Power Query, loading it into the model, put 1 measure on it, go back into Power Query, delete the empty column, re-load the model, and continue putting measures on the table. But, I don't see an option to do this in SSDT (in Visual Studio) without using a calculated table. Is this possible? If so, how?

You don't want to do that. If the table has no columns, you won't be able to see the measures in Visual Studio:
I would create a one column table using the DAX formula ={""} and hide the column in the model and not worry about it.
If you want to name the column and have no rows, you can use this more obscure formula:
=TOPN(0, ROW("Column", ""))

Picking up (and perhaps simplifying) TheRizza's excellent idea - for which thanks - I used this:
You can obviously (I presume) create as many columns as you like. I tried putting a measure in the second column, then removing this from the table calculation formula, and SSAS moves the measure back into the first column (so you don't lose it).

Related

can't figure out how to assign column from Dim table to measures group

DW is written in foreign language so i translated it on pictures.
It is about some facility where you can rent rooms and equipment.
In Fact table i have one measure column which represents number of reservations and it works as expected, problem is in DimPayment table i have columns PaymentSum and PaymentSumWDiscount which i would need to use as measures. i tried to do something in calculations tab but i only get null values
I can't figure out how to use columns PaymentSum and PaymentSumWDiscount
as measures
i tried to do something in calculations tab but i only get null values
JOIN the FactReserving table to the DimPayment table in the Data Source View and then you can access those two columns in the Measure group.
It looks like you want to use your Dimension attributes as measure.
One way to achieve this is to make your Dimension table as a Measure Group as well.
The following example works with the AdventureWorks sample to create a measure group for the Product table:
In Visual Studio / SSDT, open your Cube, create a new Measure Group and select your table. (for your scenario, it would be the DimPayment table).
Your dimension usage mapping for this would be 'Fact' as both your fact and dimension are in the same table.
Now, you should be able to use the measures normally.
All the numeric fields automatically added as measures:
Using it as a measure:

In Tableau, Is it possible to give Column number in Column Shelf

I'm using Tableau. So, instead of giving the [Column_name], Is it possible to give [Column_number] in column shelf?
- Hariharasudhan. R.
No -- for good reason.
Think of the data source as a template for a potential SQL (or MDX or TQL) query; specifying tables, joins, unions and possibly some where/having clauses for data source filters.
The actual SQL generated for any particular view will be an (optimized) query that only selects columns that are actually needed for that particular view, adds where/having clauses based on the filters being used etc.
So a column doesn't have a fixed number. The same column may be the first field selected in one situation, the last field in another situation, and left off completely in another.
If you want to change the name of column shelf:
Create a duplicate of variable and change original with duplicates and assign name as your wish by right-click on Edit Aliases and change as per your requirement.
Go to Data Source
On the middle right corner check on Show aliases
Go to column and right click on it. Go to Rename

How to Browse MS Olap cube in Excel NOT using Pivot Table

Suppose you have a 2 dimensions cube (Units Sold) in MS Olap. Dim 1 is Product and Dim 2 is Country. In the 'Units sold' MS olap cube the cell having the coordinate ('Car', 'France') have a value (says '123').
If I set up a Pivot Table in Excel, the cell with reference ('Car', France') may show a complete different number (depending of the filters ... of course). Is there a way to have still the right number ('123') : the ideal is to have both : the filtered and the one ('123') from MS Olap.
Think 'Hide' (discrete items) instead of 'Filter' when you tick/untick items in a filter.
What you're trying to do is use one measure to do two things at the same time. Which you can't do straight off the bat. However, there are workarounds.
These are all local to Excel only (not server side) as I'm assuming it's only for you. First solution is obvious, second is better, third and fourth use an extension (fourth is my preferred method as it avoids horrendous MDX code).
1. Second Pivot Table
Create a second pivot table. First pivot table filtered by Product, Country and second pivot table by other criteria AND Product, Country. You can link the pivot tables with a slicer to choose different values for Product, Country.
2. CUBE formulas in Excel sheet cells
You don't actually need to use pivot tables to access cubes (depending on the implementation).
=CUBEVALUE("Sales","[Measures].[Profit]","[Time].[2004]","[All Product].[Beverages]")`
These CUBEVALUE formulae are based off the MDX code that goes into the Microsoft Analysis Server implementation. It goes like this:
=CUBEVALUE("CUBE NAME","[Measure Group].[Measure]","[Dimension].[Attribute]","[Dimension].[Attribute]")
You can add in whatever dimensions/attributes you want then.
3. Use the OLAP PivotTable Extension.
This allows you to create your own custom measure for individual pivot tables. Once again, using MDX. I believe you can do a similar thing like with the Cubevalue formulas - i.e. add in whatever dimensions/attributes you want on top of whatever will be filtered.
https://olappivottableextend.codeplex.com/
4. DAX Studio
DAX is the query language that powers PowerPivot. DAX studio allows you to connect to PowerPivot models and run queries - similar to SQL but just using a different language..
DAX studio allows you to connect to OLAP Cubes too. So you can perform queries against a Cube, then export it as a txt file, linked table in excel etc.
https://daxstudio.codeplex.com/
If what you'll be doing is basic, you could probably get away with 1 or 2.
However, I do highly suggest you take a look at the OLAP PivotTable Extension anyway. It has a feature which allows you to paste a list of values to filter by - instead of having to manually tick them all.
Saved me hours of woe!

In SSRS 2008, is there any way to add all dataset fields to a table at once?

I'm working with SSRS for the first time. When adding a table to a report, is there any way to add all fields of a dataset to it at once or does it have to be done individually? Drag & drop, insert column -> right is a pain when there are a lot of fields that are being displayed.
It's a bit of a workaround, but the "Add new report" wizard automatically creates a table with the specified columns and groups from your given dataset. I don't believe there's a way to trigger this functionality from within an existing report, but you could create a "sacrificial" report to get what you're looking for - run through the wizard, generate the table, and copy / paste it into your original report. As long as your datasets are the same, it should work just fine...
Hope this helps.
I have a similar problem as the op and am new to SSRS/BIDS. And, I am updating a previously created report which (for me) is too complex to just quickly re-create using the "wizard generation" as the datasource is a web service (with code-generated web service parameters, lots of calc'd datasource fields, etc). It is faster to just copy the .rdl, delete all, and create the table manually.
I thought I would add that (only a little better than op's method, but nonetheless it is time-saving) you can just drag and drop to populate columns w/o the "right click > insert column > right". Just drag the dataset field to the place you want it in the table and BIDS/SSRS will automatically insert a new column. It also helps to drag the latter columns first (i.e. always inserting a previous column) so you don't have to scroll to the right all the time.
I was looking for the similar thing and I have figured this out. Open your report in Report Builder 3.0 which is a free BI tool by Microsoft. Go to Insert > Table wizzard. Then just follow the wizard steps to generate auto columns. Save and reopen the file in your visual studio, file will refresh itself.
Ved
#Kevin Fisher actually there is no need a workaround. There is way to do this out of the box of Report Builder 3. Open your existing favorite report template. on the tool bar, click on INSERT tab, look for TABLE icon, click on the down-ward arrow at the bottom of the TABLE icon, then choose TABLE WIZARD. Then I guess you know what to do from here. -hope this help.
I agree that there is no way to bring all of the columns over from the data set to a table easily. But I came up with a method that helped me:
Insert a blank table (this usually gives you 3 columns). Then insert columns to the right of the table (right click, Insert Column, To the Right), as many times as you need in order for it to equal the number of columns in your data set.
Once you have all the blank columns created in your table, click inside a table cell box and use the drop-down to select the field. This has the added benefit of allowing you to get the fields in the correct order, since I've noticed that the field names in the dataset don't always appear in the same order as the SQL stored proc output.

Creating a table in Crystal Reports Basic (one built in vs2008)?

Is it possible to create a table with this crystal reports, because I need to layout or format my data into a table(not cross tab), is there a way to do this cause I think my tool box is only limited to lines and boxes and basic shapes.
There's a few things you can do to make it look like a table:
Create Each row in your report represents a row in the table.
Put a border/box around the table use the 'Insert Box' from the toolbar and simple start drawing the box in the header of the (or group header) and finish in the footer (or group footer) and when you preview the report you'll see a box around the whole table [report]
Column grid lines can easily be done by linking the top and bottom of your box. they will then expand out in preview mode.
Top Tip: Zooming right in, to say 300%, makes getting the joins much easier, and investigate snap-to-grid you may want to simple disable it it may actually make life easier,(when ultimate precision is required)
If you need to display the data as a table, you can get creative with details, groups, subsections, and formulae. For example, the formula sum({A},{B}) adds all the values of {A} for each group {B} (best used in a group footer). If you have any specific questions, I can try to answer them.
Sorry, but Crystal reports can not create tables. It can execute a stored procedure that creates tables, but that's really the procedure creating the tables.