Browsing SSAS Cube in excel - Pivot not giving expected layout - pivot-table

I have a dimension 'XYZ' with hierarchy up to level 7. When I drag level 04 of this dim (along with other dim) into pivot against measure value. I am getting below display. And this is expected result. Here I am connecting excel to cube from environment test1.
Problem is when I am browsing SAME thing with exactly same measures and dims from other environment test2.
When I drag level 04 of 'XYZ' dim (along with other dim) into pivot against measure value, it always shows level 02(highest level). whichever level I drag into pivot, it only shows level 02 as below.
Cube structure in both environment is exactly same and version is SSAS 2014. And one excel is being used to connect to both different cubes form 2 different test servers.
may this be an issue with excel pivot setting?
Please help . any tips, tricks, suggestion will be very much helpful.
Many Thanks

Related

Pivot shows single record field value that doesn't agree to tabualr data model value (source data) - misaligned?

I have found something I'm a little concerned about. Was trying to get a measure working and had it as a calc column previously so was comparing the 2 different outputs and checking for line by line differences. I picked a good one and investigated. calc column value was zero, measure value was £42. The calc column is correct. So i drilled into my measure to see what i could find. Alarmingly, I found that for a certain field called DocumentStatus the pivot showed it as "LIVE". But if I go to the table in visual studio and find that order the status is "COMPLETED". I have checked and rechecked. There is only 1 order on this table with the right DocumentNo. The pivot seems to think this order is LIVE but the source data definitely shows it as completed. What??? How can this happen?
So strictly speaking the measure is actually calculating correctly because it is seeing the order as live therefore picking the £42 value is correct for that formula. The calc column is correct because it is seeing the order as completed so picking zero as the final value is correct.
It is the fact that the record is being seen as both live and completed that is throwing me. I'm concerned to say the least. This feels like a bug. I have checked and have no other filters in play. I have checked other ways too - like filtering on all orders with a £42 value in a particular field - none of the have a LIVE status. Its almost like that field is misaligned in the background.
Has anyone ever seen this?
TIA
SSAS Tabular; SQL Server 2016, Visual Studio 2017
Edit 5 Jul:
Thanks for your comments. Unfortunately I cannot provide sample data due to strict confidentiality. I have provided 2 screen shots below, both showing the same record - (1) is the view from the excel pivot table that is connected to the ssas tabular data model (2) is the view of the table in Visual Studio (note how the value of the Accrued Income measure in this view is not the same as the AccruedIncome total in the excel pivot table)
I am wondering if this is to do with the way that I have deployed recent edits to the data model. Every time I make a change I am running the deploy & build commands so that I can refresh the excel reports to see if they are working as intended. What I don't know is when I do this am I deploying the metadata only or the metadata and the actual data (several hundred thousand rows on a dozen or so tables)? Is the issue here that the pivot is looking at an older set of data than the dataset visual studio is looking at? When I deploy & build do I then need to process the SSAS tabular object to update the data?
Also note how the DocumentStatus is different in the 2 views.
Excel pivot
Visual Studio

crystal reports missing columns

OK, first question here so go easy!
Let's start with some quick background - I have been working with Crystal almost daily for the past 15 years to so, so I like to think I am not too much of a dummy.
Today, I have stumbled across a problem I have never seen.
My source data is from SQL Server 2012 Standard.
I have created a view, nothing too complicated. It grabs PartNo and Description from an Inventory Main table. Then a few other columns from other related tables so I can see the data neatly in a single view, so stuff like carton qty (how many units go into 1 carton), height, length, depth.
Now, bear in mind I have done these kinds of views so many times in the past I couldn't even count.
Now, in Crystal Reports 2013, I connect to SQL via OLE using sa credentials, find my view. Pop over to the "Links" tab in the Database Expert, and my columns created from the related tables are not listed! Only PartNo and Description are visible.
I have scratching my head over this for the past few hours & the only thing I can put it down to is some kind of weird Microsoft update.
My SQL view results:
SQL view
What I see in Crystal
Database Expert, Links
the other way to test this is instead of a view or table just add a
command and select * from yourview
the only downside i think would be using sql expression from a command connection.
another option is to
To define the data type in the view... same with dates. does not like
to be converted otherwise will treat it as a string

SSAS (2008R2) & Excel Filter Issue When Refreshing Data

We have an instance of 2008 R2 which is running approx 6 cubes. The situation I am finding is as follows.
A user connects to the cube via MS Excel 2010 using the normal Data Sources method.
Lets say they create a very simple pivot table...Accounts on the rows & Months on the columns with a measure giving us the total value for each Account. At the time of the user creating the report there were 11 months of data in available in the cube (Jan > Nov) so the pivot table reflects this in Excel. The user has applies a few filters (say 5) on the row to select some Accounts ad hoc. The user then saves this file to his desktop and leaves it until Decembers data has become available in the cube. December is upon us and we refresh the cube so that it now contains Decembers data as well. The user reopens the Excel file and right clicks on the pivot and refreshes the data with the expectation of seeing a full years data for the five account selected but this is not the case. What in actual fact happens is that all the data which is there before is lost and the pivot table is completely blank. Can anyone help with why this is happening and a potential solution?
I have an idea in my mind that Excel is storing the accounts being filtered using some unique identifier and when the cube is reprocessed for the new month new unique IDs are being assigned to the accounts and therefore a match is not happening. There must be a work around to this as otherwise every report which is generated is effectively a throw away effort. Cheers!
In my case this indeed was caused by the poor cube design: the generated MDX referenced an ID that changed every time the cube was rebuilt:
WHERE [Log Author].[PM PRIMARYKEY].&[29872574],
I agree the best way to fix this is to change the ETL.
PS The way I viewed the generated MDX (thanks to Marco Russo) was by selecting the pivot and then running this macro (open VBA, paste it, hit F5):
Sub DisplayMDX()
Dim mdxQuery As String
Dim pvt As PivotTable
Dim ws As Worksheet
Set pvt = ActiveCell.PivotTable
mdxQuery = pvt.MDX
' Add a new worksheet.
Set ws = Worksheets.Add
ws.Range("A1") = mdxQuery
End Sub

SQL Server Analysis Service: Need to suppress empty results

We have a very sparse cube in SSAS. The size of the cube is only 50M bytes in MOLP storage. When writing your own MDX query, you can use NON EMPTY/NONEMPTY to suppress/filter out empty results. But we have a 3rd party tool (Cognos Analysis Studio) for our Business Users to run ad-hoc analysis against the cube. At first the users drag in dimensions and measures using Cognos Analysis Studio, the initial results come out with empty results. Then the users try to suppress the empty results. It takes an extremely long time to come up with non-empty results.
Since the MDX is generate by Cognos, we don't have control over how the MDX is generated to run against the cube. Our users using this cube are only interested in non-empty results. We'd like to know if there is a behavior control in a SSAS cube to always return non-empty results.
Question:
How can we set (or achieve) a cube-wide behavior to always suppress empty results?
I think the feature you're looking for is called "zero suppression". Click on “Settings”, “Suppress”,
“Zeros and Empty Cells”. This changes the default which will only suppress empty cells and not cells filled with zeros. Or, click on a column in the report. Click on the “Zero Suppression” icon at the top. Any row that is filled with zeroes will disappear.
You can google on "zero suppression cognos" to get more explanations about this.
I don't know if Cognos Analysis Studio allow using sets. If so, try creating non empty of dimension attribute against default cube measure in MdxScript. Then use this set instead of original dimension attribute.
For example
CREATE CURRENTCUBE.[Set1] as NonEmpty([Dim1].[Atr1].allmembers, [Measures].DefaultMember);

Cross-reference Distance chart in SQL Server 2008 or Excel?

I would like to cross-reference construct a distance chart similar to the one here (example is a road-distance cross-reference chart) and, ideally, store the data in SQL Server 2008 (preferably the Express version). It needs these properties / abilities
Every column has a corresponding row with the same name (ie. not misspelled like my example).
Changing the value at one Row-Column intersection would update the mirror intersection (Column-Row) or the mirror data could be ignored.
The distance-values would need to be end-user editable.
The end-user would need to be able to add, delete or rename a column/row pair.
The end-user needs to be able to sort the columns and have the rows move automatically.
There could be hundreds of pairs.
a look-up query needs to find a distance given a start & destination (Row & Column)
The distance chart is reasonably straightforward to implement in Excel. Considering this, am I better off...
Using Excel as the user editing UI and then updating an SQL 'thing' with the new data?
Using Excel as the data-source even if it means performance issues with querying the data?
Using an as-yet undiscovered stroke of genius detailed here in an answer?
Sure looks like an Excel application to me, start to end. (heh)
I can't imagine your users typing enough data in to make performance an issue. Excel will only take 32757 rows by ditto columns. If that's enough, I'd say you're golden.

Resources