How to refresh metadata of existing table in ssas tabular cube - ssas-tabular

I have build one SSAS tabular cube and today new columns are added to Fact table of my cube. How to refresh metadata and get those columns in the cube step by step.

Related

how to create table to hold measures in SSAS tabular cube

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

Get value from Measure in OLAP Cube and Insert it in a SQL table

I need help with the the following:
I got an OLAP Cube, let's call it "company_prod" on "server\instance"
That Cube has (among many) a calculated member called "[Measures].[Value]"
One of the Dimensions in the Cube is for time (Year, Month, Date and so on). e.g. [TIME].[Y_M_D].[YEAR].&[2020]
Our main frontend is Excel, where we retrieve Data from the Cube with CUBEELEMENT, CUBEVALUE etc.
We got some measures which unfortunately, when I update the Excel report now and show numbers for last year, the result is different when I update that same report in a few weeks or months. This is something I won't be able to change and in some reports it's the desired behaviour because underlying data from SAP is changed and sometimes valid_from and valid_to dates are changed retroactively.
Now I want to get the value from my "[Measures].[Value]" on a certain date, let's say April 1st. I then want to insert the value I get on April 1st for 2020 in a SQL table. This should be done by an agent job that executes a stored procedure or runs a dtsx package or anything else, whichever works.
I hope it's clear what I am trying to accomplish...
If you can create linked servers from your SQL Server to SSAS Server, then you can run your MDX query against the linked SSAS Server using OPENQUERY and save the result directly to the SQL Server table.
i.e.,
INSERT INTO <your table>
EXECUTE <your mdx statement> AT <linked server>
You can add the run the above via your SQL Agent job on schedule.

Tabular model issue

The below is my tabular model, both are dimension tables. However, I am not able to filter the policies on Effective year from PolicyEffective date table when trying to browse the data in the pivot table.

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!

Report with Mondrian cube not yielding results

I am bit new to iReport and JasperReports. I have a mondrain cube and want generate reports from olap cube. In this direction I tried few things. I connected my OLAP cube's schema as datasource . created new report and passed mdx to it. But I am not getting any output. Please guide me on how to do this thing .