Showing posts with label dimensions. Show all posts
Showing posts with label dimensions. Show all posts

Friday, March 23, 2012

Number of projects in each state?

Hi,

I have Cube that manipulating projects information with following dimensions:

1- Year

2- Project Name

3- Executing Department

4- Project State (e.g. Initiation, RFP, Tendering, … )

In the Cube, I want to display the number of projects in each state using Calculated field, or any other suggestion.

Thanks.

I'm not sure if I understand your problem, but you should be able to add a count measure to your measure group (it should do this by default).

If this doesn't answer your question, could you describe a little more about exactly what problem you are encountering?

Friday, March 9, 2012

NullProcessing and Reference Dimensions

Have a Measure group in a fact table. This fact table links to the project dimension and the time dimension. In the project dimension there are some additional dates like ProjectStartDate and ProjectDueDate. So I create a new time dimension for these dates.

So for the Measure Group / Time (ProjectStartDate) combination, I define the dimension usage as a reference to the project dimension.

But when I process I get som errors on ProjectStartDate that date values (the NULL date) not exist time dimension (which is correct).

To solve this I try to set up the NullProcessing for these dimensions. But in contrast with a regular dimension there is no advanced section for reference dimensions.

Also the following don't solve the problem: setting NullProcessing on the ProjectStartDate attribute in the Project Dimension, setting NullProcessing on the Time dimension or setting NullProcessing on the project dimension.

Anyone know how to achieve NullProcessing:UnknownMember on a reference dimension ?

tx /Dirk

Try and solve this problem by defining Named Query in your DSV.

Replace your dimension table in DSV with Named Query that filters out NULL's.

Edward.
--
This posting is provided "AS IS" with no warranties, and confers no rights

|||

Filtering out the NULL's is not really an option since it would remove data from the cube.

I could fill in the NULL with dummy values (although for a time dimension this stays stange) but that's exactly what the NullProcessing should do. Put in a (black, zero, are UnknownMember) where there is a Null in the attribute or related key field.

For attibutes you specify it in the properties and this works fine.

For regular dimensions you specify this in the advanced options and works.

But what to do for a referenced dimension ? There is no such option, so I thought that specifying it in the referenced dimension might do the trick but it doesn't.

|||

You are right. In this case Analysis Server behaves differently.


But taking this aside. In general you are running into age old problem of having clean data and good referential integrity. Telling Analysis Server to hide some data that you have no keys for under Unknown member is not such a good practice. You will see your totals not summing up when try and sum child nodes manually. Strange things like that can create a perception with the user of Analysis Server showing incorrect data. You might be solving problem in short run by changing processing options, but in a longer run, you will be showing your users "inconsistent" data and that is in my opinion is quite dangerous

Edward.
--
This posting is provided "AS IS" with no warranties, and confers no rights.


|||

Thanks Edward,

Just thought that SSAS would make life a little simpler, Just have to get my ref-int scripts updated I guess. Still stupid that SSAS supports some cases but not all, which indeed makes it more or less useless.

/Dirk

Nullifying Measure not related to the displayed dimension, yet displaying Grand Totals

Hello,

I have 2 measure groups; say X and Y. X is related to the dimensions products and customers, while Y is related to Products only. I needed to create a view combining measures from X and Y. Now if I drag a measure from Y in front of the Customers dimension members the total for that measure is displayed in front of every Customer there. What I really need is to set the measures from group Y to Null when displayed in front of individual customers, and display their total value only on the Customers.All level and for 'Grand Totals'. I tried created a calculated member over that measure to act as a filter by using IIF function to check if customers.currentmember.level.ordinal > 0 to set the calculated measure to Null, else display the underlying value. Things work fine now in the BIDS Browser, but when I try to create the same view in ProClarity the Grand Total is Null. Any Clues?

How about setting IgnoreUnrelatedDimensions to false for Measure Group Y?

http://msdn2.microsoft.com/en-us/library/ms365411.aspx

>>

SQL Server 2005 Books Online

Configuring Measure Group Properties

Measures groups have properties that enable you to define how measure groups function.

...

IgnoreUnrelatedDimensions

Determines whether unrelated dimensions are forced to their top level when members of dimensions that are unrelated to the measure group are included in a query. Default setting is True.

>>

Monday, February 20, 2012

Null Problem

Hi, i have this problem (I'm using analisys services 2000) i have a fact table Services with two dimensions Clasifications, and Prices.

The fact table has three dimensions IdServices, IdClasifications and IdPrices, idclasifications and idprices are fk to the tables of Clasifications and Prices.

I wan to count the services so i have measure on the field IdServices wiht count.

The problem is that it doesn't count all the services, all the services with the field idclasification in null are not count.

Is there a way to solve this?

Thanks

Create a count measure with a row binding instead of a column binding and it will count each row in the table regardless of it's contents. In the Cube Editor, click on the New Measure toolbar button (or menu item) and then in the New Measure dialog set the Usage to "Count of Rows" and then set the table to your Services table.|||

I am in analysis services 2000....

I don't find how to set a measure usage to "Count of rows"..

The solution you gave is fot AS2000?

|||My answer was for Analysis Services 2005. For AS2000, you'll need to create a SQL expression in the SourceColumn that returns a distinct, non-null value for each row in the table. If the table has a key, use the columns that make up the key. You can concatinate them in a SQL expression and some delimeter that you know is not contained in the columns.|||I have to create a calculated member, or i change the source column of the measure ( i have no idea how to make the that sql expression :( , i was trying but i can't do it)|||In AS2000 you can actually embed a SQL expression in the SourceColumn property for a measure. The easiest way to come up with the working SQL expression is just to write a select query on the table which uses an expression to create a calculated column. If the expression works in the select, then it will usually work in the SourceColumn property. You also have the option of adding such a calculated column to a view in the source database and then building your cube over that view.|||Yes, i know how to embed sql in a source column, and also i use viewsin the cube, the thing i did'nt understand is the sql expression, i don't catch the idea, in other words i don't understand how to make this sql expression to consider all the rows...|||

The idea is simply to identify a candidate key - a set of columns that uniquely identifies each row - and concatinate these columns into a single column value. In the worst case scenario where all columns are independent this could mean concatinating all columns in the table. If this is the case, you'll probably want to go back and add an identity (a.k.a. autoincrement) column to the table to serve as a key. As an example on the SQL Server sysobjects table, you could concatinate the name, id, and xtype columns into a single column using the following query (although this is not necessary for sysobjects since name is already unique and non-nullable):

select name + '|' + Convert( varchar, id) + '|' + xtype from sysobjects

|||

In my case, i have a unique id field, is the field that i using to count...

My original problem is this:

I have a fk in the fact table to a dimension, this fk can be null, i have other dimensions too, the problem is: in the fact table i have only the rows that this fk field is not null, and i want all the rows... I need all the rows becaues i want to examine the data using the other dimensions too..

|||

Ok, now I understand. To have counts for the rows with null FK values included in the cube, you must associate members in the dimension the FK refers to since ever cell must have a co-ordinate in each dimension. The easiest way to do this is to add a new "unknown member" to the dimension table (can be done with a SQL view using a Union) and then replacing null values in the fact table FK column with references to the new "unknown member". The null replacement in the FK column can be done with a SQL expression either in a view or the source column property.

Null Measure Data Processing....

Hello,

I created a cube with measures and dimensions using AMO. The measure group comes from a table called "client_coverage", and there is a measure called "count". There are also 2 dimensions, namely "TimeZone" and "Source".

For example,

Coverage

ID TimeZone Source

-- -- --

1 null null

2 null null

I've programmably set the "null processing" for measure "count" to "preserve", and both dimensions' UnknownMembers to "visible" and set their key column's "Null Processing" to "Unknown Members".

However, when I browse the cube, there is no number shows up for the coverage "count" measure. I've checked that the dimensions are setup correctly with proper relationships to the coverage measure group.

Interesting thing is, if I remove the cube dimension manually from the cube using the Business Intelligence studio and then right away add them back in. Then the number shows up.... like :

Source Count

- --

Unknown 2

I wonder if there is something needs to be done in my AMO program when adding the cube dimensions (the things that the BI studio does automatically).

Any help is very appreciated..

Thank you very much,

Sincerely,

Hsiao-I

Ah.. I found out that I have to set the relationship between the measure group and the dimension's "Null Processing" property to the same as the Dimension's Null Processing property... that solved the problem!!

NULL in dimensions

Hi,

I have designed a dimension with following properties

Member Key = PID

Member Name = PID+'--'+Description

Now, If PID=1 and Description = NULL then it gives me Member Name as NULL whereas actually I am expecting 1--

Please let me know if there is anyway through which I can acheive it.

Also, I am using AS2000

Thanks,

Hi,

I got the solution

set member name as pid + '--'+ isnull(pdescription,'')