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

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

Related

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

How do I display certain results based on criteria in Visual Studio 2012?

I have a database in SQL of phone numbers and the country of which they have been called in.
Moving this onto Visual Studio I have a very simple table that lists the relevant country and the amount of calls they have received.
This is run by a dataset with 'CountryOfCall' as the sole column
In the report 'CountryOfCall' is one column, while 'Number Of Calls' is the second.
The number of calls is generated by =count(Fields!CountryOfCall.Value) and these are giving me my desired results.
But what I would like is the report to only show instances where a country has received more than 50 calls and strip out the not so active nations.
Therefore how can I get my Visual Studio report to do this as I can't seem to filter the calculated results. Would this be something that is needed at expression level in the text box?
Thanks
Dan

Pivot off of access query is misbehaving

So I have a document that has a pivot table that was previously linked to an access query. It worked fine, no issues. The problem started when I wanted to change which database the pivot table was linked to. When I tried to change the external data source to the new database, excel gave me the "cannot complete the task with available resources" error. I find this error can be a little finnicky so I tried deleting the pivot and creating a new pivot with the link I want, except now the pivot comes up empty. It pulls in the column headers (in the pivot editor thing) but no data comes up when I add fields to the pivot. I should also add that the new database is exactly the same as the old one - the only difference is a new column of data.
Any thoughts? This is driving me crazy. It might be that the results from access are too big for excel to process, but I've been paring down the results and none of it makes a difference.

(Null) Values in SSAS cube when selecting a role

I have the following problem:
When I process a cube in SSAS and view the data as a normal user without restrictions all is well and the aggregated results show their normal values.
When I choose inside Data Tools (MsSQL 2012) to view the data as a specific role then all the security constraints work normally (For example I view only the Specific country data and no other) but all the corresponding values are (null).
I have tried Visual Totals = true and I have imposed those restrictions on both the dimension and the cube. The CALCULATE in calculation script is still there (everything works ok when I choose to use a normal user).
This is happening on both the measures and the calculated values!!!
Any ideas what could be happening?
Solved.
This problem had to do with cell data!!!
The Data Tools studio automatically checks the enable Cell Data permissions checkboxes in the respective tab.
If no MDX query is defined in these, then it is automatically assumed that you have no permissions to view any aggregated measure data!!!!
Uncheck them or define the proper MDX query and the problem will be fixed!!!!

Linked Informix table in MS SQL Server ignoring criteria?

I’m having a problem with a linked Informix table in MS SQL Server 2008r2. When I query this table, it seems to ignore some of the criteria I’m passing to it but not others. For example if I put a condition on the rowdate field the remote query part of the execution plan does not show any WHERE clause but if I put criteria on another field such as ACD it does show.
It seems it does not pass any criteria on the rowdate field but does on all others.
I know the field is indexed on the Informix side. If it helps the table I’m linking is from Avaya CMS and it is linked via the OpenLink ODBC driver.
EDIT:
As far as I know it is Informix Dynamic Server 2000 and it is on Solaris. The column comes up as a DATE data type which is correct. I have tried passing the criteria as ‘2010-08-03 00:00:00’, ‘2010-08-03’, CONVERT(date,’2010-08-03’) and a few more variations. When the data is returned to SQL server it is in the format yyyy-mm-dd.
When I view the execution plan I can see the remote query with all the other criteria followed by a filter for only the rowdate field.
I know that rowdate is indexed and that the driver does normally communicate that information as we use it in other applications (Business objects and MS Access) and they don’t have a problem
I managed to figure it out but it is the strangest thing ever. I went down the route of passing the date in different formats. My default is to use the normal YYYY-MM-DD that of course did not work so I tried YYYY-MMM-DD, still nothing. After going through LOTS of combinations I found one that works Mmm-DD-YY and it has to be exactly that! SEP-21-2010 wont work but Sep-21-2010.
I wonder if this is just a strange hang up from Informix or something in the driver, anyway it works.
On a side note has anyone noticed how strange it is that people from the America write the date month, day year? Stop and think about it for a second, do you say the number 2410 as “Four hundred, ten, two thousand”? The best part about it is try asking yourself this, what day is American independence day? Most Americans say “That’s easy you limey person it is the 4th of July” hmmmm day month (year), the only date they say round the right way is the date they got their independence. I will leave it up to the SO community to see the irony in that
Example query below:
select *
from OPENQUERY (AVAYA, 'select row_date,starttime,intrvl,acd from root.hagent where
row_date = ''NOV-22-2012'' and acd = 1 and split = 1 and starttime = 1900')
By the way I managed to extract accurate data via both MMM-DD-YYYY and Mmm-DD-YYYY.

Resources