I am trying to create a cube in microsoft analysis services, but i failed to preserve the null values. It always return as 0. In my database (SQL Server 2005) i have two fact tables and two dimension table and a date table. In my fact table I have 0 values, null values and some positive values.
Here is what i have done so far
In the above picture the values for Bigeye tuna and other tuna is null, but it is showing as 0, the value for EEZ is 0 in the database and it is shown correct. I have set nullprocessing to preserve as shown below
When I set # as the format string the value for EEZ is also gone.
Here is the database table
I want it to show the value of EEZ(11) as 0, and remove the values of Bigeye Tuna(9) and other tuna(10) as it is null in the database also.
So can anyone tell me how can I accomplish this?
This should work w/o additional format settings. Are you sure there are no mixed values 0 and NULLs?
Here is my example, last column is a source for fake measure with zeros and NULLs:
Here is measure settings w/o format:
Finally, here is browser with empty cells turned on:
Everything should work as above.
Maybe it's connected with hidden level. Could you temporary turn EEZ lower level back and see value there?
Grand total shows zeros in Excel instead of 10.3K, 104.5K and 114.8K. Is there some SCOPE, which manage totals or other parts?
And also please check mixed 0 and NULL values for the same group/member.
Related
In SQL Server Analysis Services, I want to convert the column T DATA into a measure. However, the column T DATA is nvarchar(120), which confuses me because I believe I can only convert numeric values.
To create and add all of my measures, I have created a numeric and integer type column in a dimension called PROJECT Measures.
ALTER view [tabular].[PROJECT_Measures]
as
select top 0 Measure_Project_Con_Det = 0.,
Measure_Project_Invoicing_Plan = 0,
Measure_Leegoo_Builder = 0.,
Measure_Project_Sub_Project = 0.,
GO
Now I want to modify this view by adding a new column called LB Wert into which I will insert values from T DATA. Then, in Visual Studio, create a command that calls the T Data column in LB Wert. I have no clue how to do any of this.
Any ideas?
Edit --
So for example,
enter image description here
In above image you can see 2 columns Attribute Name and Tdata. In Tdata column, the values are text or numbers. However, I want to use this column as a Measure. Now, when I try to make a measure in Visual Studio, I get Sum, count and other options and I don't think these are helpful.
enter image description here
Outcome,
enter image description here
In above image, as you can see, I have used Sum in some columns, to use them as a Measure. However, it is only possible for numbers. And I want to use these measures in Excel, Analysis Service. For example, below image.
enter image description here
In short, I want to use Tdata column as a Measure. But, I don't want to count or sum function.
I hope I am clear and sorry for confusion.
For some reason stacked column chart displays "Blank" value even though data behind doesn't have any Blank or '0'.
And my X-axis doesnt have "Type" where I can choose between continuous or categorical:
In a data behind I have 12 months, no blank or 0 :
The (Blank) value can occur even though your underlying data set has no blank values. It is because when you have established relationship between tables, and there are other visuals or filters on the same report page, leading to a joining or filter which results in blank values.
It can be hard to pinpoint sometimes, so the easiest thing you can do is to filter it in the Visual level filters as follows:
As for the X-axis continuous or categorical type setting, it is only available when the data type is numerics or date/time. The MonthShort column you're using is just text to Power BI and it has no idea in what way it should be continuously linked. You need to use the MonthNumber or a date column if you want to achieve so.
I would need your help with and SQL query that has to remove duplicate entries from a table, mostly using the datestamp column as a criteria in two passes.
Microsoft SQL DBMS is in question.
Here is a little more details:
Terminology: Module is basically a group of single machine workplaces onto which users operate.
Table:
ModNam column is fixed, there are 15 modules from M A01 to M A15, then goes the B row M B01 ... M B15 and so on until row F.
Pos column is irrelevant at the moment.
MdCod column represents a code of the machine being added to the position in the certain module. It can be replaced by another machine at any given time.
I have one query that will be inserting data into this table by copying entries from another table, every time a new machine is added to one of the positions.
Tricky part for me is a second query that should be comparing records in two phases and if:
1) Inside same module (first pass of the query represented with red color in the example pic attached):
ModNam value is the same, MdCod matches between the entries then the most recent datestamp decides the single one to stay and others duplicates get deleted
2) Inside other module (second pass of the query represented with purple color in the example pic attached):
ModNam values are different and MdCod matches between the entries then the most recent datestamp decides the single one to stay and others duplicates get deleted.
Please help and advise.
Example pic (updated):
Thank you all in advance.
I'm fairly new to SQL and I have been issued my first report to build. I have written an SQL query to give me a set of results that I would like to publish in a report.
I have unioned about 20 small queries all containing the correct amount of columns. One column is a misc column with about 15 different descriptions in (this is what I want to count).
I have uploaded my data set and now want to be able to choose a cell in my report to bring back a certain description.
At the minute I'm using
=count(fields!misc.values)
and it's giving me the whole count, about 200.
I would like to know if there is any kind of "where clause" (filter) which I can use to state which description results I want to bring back.
You can use am expression to count the misc.value you need. It will work like a count using a where clause:
=Sum(iif(Fields!misc.Value ="Some description",1,0))
Example:
For count the FSMethod with MethodOne as value I used this expression:
=Sum(iif(Fields!FSMethod.Value ="MethodOne",1,0))
Note the expression sums by 1 if the FSMethod.Value is MethodOne.
For count the rows with FSMethod column with MethodTwo value.
=Sum(iif(Fields!FSMethod.Value ="MethodTwo",1,0))
Let me know if this can help you.
G'day,
I'm a total n00b when it comes to SQL Server reports and my Vb.Net knowledge is ageing now.
I have a detailed report of rows in a database, with one of the columns that is nullable. What I want to do is show a simple pie chart over the data in the result which shows how many rows have a value and how many do not.
I can't work out how to write the Count() aggregate in the expression for the data series so that it filters.
eg.
I have 10000 rows of which 2000 have a null. I want a pie chart that shows two results, one small pie chunk with 2000 and a larger pie chunk with 8000. When I try and do =Count(IsDbNull(Fields!TransactionID.Value)) and =Count(Not IsDbNull(Fields!TransactionID.Value)) it appears to send the same result twice, ie. the result set is still the same size it just consists of trues and falses.
Cheers for your help.
Since you are using COUNT you are just counting values; IsDbNULL is returning TRUE or FALSE both of which are being counted.
Try doing this for the Non-NULLS =SUM(IIF(ISNOTHING(Fields! TransactionID.Value),0,1)) and for the NULLs use =SUM(IIF(ISNOTHING(Fields! TransactionID.Value),1,0))
Actually, for the non-NULLs you can just use COUNT(Fields!TransactionID.Value)
I'd use something like this
-SUM(CInt(IsDbNull(Fields!TransactionID.Value)))
COUNT(Fields!TransactionID.Value) + SUM(CInt(NOTIsDbNull(Fields!TransactionID.Value)))
COUNT literally counts values, same as SQL Sever. So:
IsDBNull gives true/false -> -1/0 -> SUM that gives you number of NULLs (minus of course)
Then take full count, subtract the SUM gives non-NULL count