Showing posts with label ssas. Show all posts
Showing posts with label ssas. Show all posts

Monday, March 26, 2012

LastNonempty return null when filter time hierarchy

Hi there,

I am using SSAS 2005 SP2. Now I have a big problem. My scenario is that:

I have a measure, inventory and set its aggregateFunction to "LastNonempty".

I have a Time dimension and create a hierarchy for it. The hierarchy contains two levels, namely Year and Month.

Everything goes fine when I display the report using BIStudio. However, if I filter the Time hierarchy and set it only to display two months like 2007, 04 and 2007, 05, the measure become null. If I clear the filter and show all 2007's months the measure displays correctly.

Does anything also have that problem?

BTW, I also tried this scenario in MS example database "AdventureWorksDW". Set one measure to be lastnonempty, and create a time hierarchy. Then, set filter to show only two months. The null problem shows again. Hopefully someone can help me to solve this problem.

Thanks in advance.

Best regardly,

Tom

If you browse the [Measures].[End of Day Rate] value in Adventure Works (which has aggregate function to "LastNonEmpty"), selecting multiple months in the filter (for example, May and June 2004) seems to work fine - no Null's appear. Can you reproduce your problem with this standard measure?|||

Hello Puri,

Let me describe the scenario I created from AdventureWorkDW.

I have four dimension tables: DimGeography, DimCustomer, DimTime, DimProduct.

And only one fact table: FactInternetSales.

After the cube was created, I set the aggregatefunction of the measure "Freight" to "LastNonempty".

Besides, I create a time hierarchy in the dimension "Due Date". The hierarchy has two levels, namely "Calender Year" and "English Month Name".

Then I deploy the created cube. I brow it via BIStudio. I drag and drop freight to the measure part and time hierarchy to the upper dimension part. Everything works fine. It can show data of 2001 to 2004 and I can drilldown to show months belong to specific year.

Howerver, if I set the filter to the time hierarchy and only show data of "April and August" in 2003, then I can't drilldown to the month level.

It will show null if I click the "+" sign next to the "2003".

Best Regardly

Tom

|||

Hi Tom,

Without trying to reconstruct the cube you describe, one issue with your time hierarchy may be the use of "English Month Name" at the lower level - since the same month occurs under multiple years, this is not a natural hierarchy. You can refer to the "Month Name" attribute in the Date dimension of Adventure Works, to see how that is defined - note that "Calendar" is a natural hierarchy in the Date dimension.

Here, you might be better off first studying something which works, like the sample Adventure Works cube; rather than first building something which doesn't, then trying to figure out why...

|||

Dear Deepak,

I tried to use Adventure Works Sample Cube. In this cube, I create a new Time hierarchy which contains two levels, Calendar year and Month Name. Besides, I set the aggregateFunction of "Internet Order Quantity" from Internet Sales group to "LastNonEmpty". Then I deploy it and browse it in the BIStudio. I drag and drop the time hierarchy I created and Internet Order Quantity to the measure part. Everthing works fines. Howerver, if I set the filter to only shows "May, 2003 and June, 2003" the null problem still can't solve. At the Year level, it will show "CY 2003" and the value of Internet Order Quantity is "10". If I click the "+" sign, it shows nothing in the month level. Could you help me with this problem?

Best Regardly

Tom

lastnonempty & role playing date dimension

Hello,

I'm just curious if in case of a role-playing date dimention it's possible to somehow tell SSAS to use only one role for LastNonEmpty aggregate?

Like we have a fact table with a few date related members - such as TransactionDate, DateOpened, DateClosed etc.

All measures in this fact table are set to aggregate as LastNonEmpty & everything works just fine as long as only TransactionDate is linked to dimDate.

If any other dates are linked then LastNonEmpty doesn't work properly anymore & we get unpredictable results.

So if it possible to set ONLY TransactionDate to be used as LastNonEmpty & for all other dates just aggregate as sum?

Thanks!

It is always only ONE role-playing time dimension. The problem is, you cannot control which one it is. Sorry, but there is no way to tell directly to SSAS which one. You can keep reordering the cube dimensions in AMO until SSAS picks the right one. After that, if the order doesn't change - it will always use the same one (it is stable algorithm w.r.t. order of dimensions).|||

Cool - thanks for the answer - at least there's a way!

Now - AMO stands for Analysis Management Objects so how do I reorder cube dimensions in AMO?

Is the order in AMO the same as the order in which dimensions are displayed in the dimension usage section of VS?

I'm kind of confused how to move them?

|||If you look at the XML behind Create Cube DDL (or Alter Cube DDL) - the order of cube dimensions there is the one I am talking about.|||

I see what you mean...

so by "reordering the cube dimensions in AMO until SSAS picks the right one" - do you mean reordering just role playing date dimensions or ALL dimensions? I have 5 date related and a LOT more other dimensions so without some further guidance it's not clear to me how to handle all the possible combinations?

BTW is it a coincidence or a rule that the order in XML is the same as the order in which dimensions are displayed in 'dimension usage' pane of VS? Appears to be that way...

|||

> do you mean reordering just role playing date dimensions or ALL dimensions?

Reordering just the cube dimensions which are marked as Time within measure group. So it your case - it would be reordering 5 dimensions. There are really only 5 combinations here - just pick the dimension you want to do LastNonEmpty by and move it to the first, second, etc places. The rest doesn't matter.

|||

Could you please be a bit more specific as the XML file is rather large (20+K lines) & there's way to many places where dimensions are mentioned - one where they're defined, one where the relationships between measures & dimensions are defined - I moved things around there with no effect, third place is where aggregations are defined like:

<Aggregation>

<ID>Aggregation 5</ID>

....

<Dimension>

<CubeDimensionID>Maturity Date</CubeDimensionID>

</Dimension>

but there's so many of these so where exactly do I change the definition for the settings to apply?

Thanks!

|||Look for <MeasureGroups> tag. Then locate <MeasureGroup> tag which mathes your measure group. Then skip over <Measures> collection and go to <Dimensions> collection. This is where you should do reordering.|||

cool - thanks - I got it working!

Monday, March 12, 2012

Last Cube Process Date/Time

Is there anyway to programmatically retrieve the last date/time that an SSAS cube was processed?

I would like to display this date/time in reports.

I could add a step to the job that runs the process to add a row to a table upon successful completion, but don't want to re-invent the wheel.

Thanks!
BobPIt is available via both DSO (for AS2K) and AMO (for AS2K5).
Just look in BOL and you will see it.

_-_-_ Dave|||

hi,

can you post an example to show the date cube was last updated in a text box on a report.

Thanks,

|||

using System;

using System.Collections.Generic;

using System.Text;

using Microsoft.AnalysisServices;

namespace GetCubeProcessingTime

{

class Program

{

static void Main(string[] args)

{

string date = string.Empty;

string cubeName = string.Empty;

try

{

// Connect to the SSAS server

Server server = new Server();

server.Connect(@."Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=Adventure Works DW;Data Source=localhost\YUKON");

// Get the Adventure Works cube(s)

Database database = server.Databases.GetByName("Adventure Works DW");

foreach (Cube cube in database.Cubes)

{

date = cube.LastProcessed.ToString("yyyy-MM-dd HH:mm:ss");

cubeName = cube.Name;

Console.WriteLine(string.Format("Cube [{0}] was processed: {1}", cubeName, date));

}

}

catch (Exception exception)

{

// Uups

Console.WriteLine(exception.Message);

}

}

}

}

Last Cube Process Date/Time

Is there anyway to programmatically retrieve the last date/time that an SSAS cube was processed?

I would like to display this date/time in reports.

I could add a step to the job that runs the process to add a row to a table upon successful completion, but don't want to re-invent the wheel.

Thanks!
BobPIt is available via both DSO (for AS2K) and AMO (for AS2K5).
Just look in BOL and you will see it.

_-_-_ Dave|||

hi,

can you post an example to show the date cube was last updated in a text box on a report.

Thanks,

|||

using System;

using System.Collections.Generic;

using System.Text;

using Microsoft.AnalysisServices;

namespace GetCubeProcessingTime

{

class Program

{

static void Main(string[] args)

{

string date = string.Empty;

string cubeName = string.Empty;

try

{

// Connect to the SSAS server

Server server = new Server();

server.Connect(@."Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=Adventure Works DW;Data Source=localhost\YUKON");

// Get the Adventure Works cube(s)

Database database = server.Databases.GetByName("Adventure Works DW");

foreach (Cube cube in database.Cubes)

{

date = cube.LastProcessed.ToString("yyyy-MM-dd HH:mm:ss");

cubeName = cube.Name;

Console.WriteLine(string.Format("Cube [{0}] was processed: {1}", cubeName, date));

}

}

catch (Exception exception)

{

// Uups

Console.WriteLine(exception.Message);

}

}

}

}

Friday, March 9, 2012

Larger Scale SSAS 2005 deployment configuration options...

I'm wondering if there is anything like

Microsoft SQL Server 2000 Analysis Services Operations Guide.doc

Microsoft SQL Server 2000 Analysis Services Performance Guide.doc

for SSAS 2005. I'm working on a 22 Gig cube (that is size with no aggs) with a 32-Gig RAM Server and want to do more tuning - I should be able to get the whole thing in RAM, no? Shouldn't that make it really fast? I'm particularly interested in all of the Analysis Services Properties for SSAS.

What does "-3000" mean for several of the properties? I was thinking that raising many of the max RAM settings could be good, but if they are based on percentages, then that would scale with the server and wouldn't need tuning. There seems to be extremely little info. I see the basic info on 3 or 4 of the RAM settings with the percentages, I want much more than that.

I've looked around and read/skimmed 3 books, but few go into how to deploy to 32 Gigs of RAM / 8 processors and get the best use of the system...

So I'm looking either for direction on a paper or book I've missed or for specific help - both are good. Feel free to mention property changes you've implemented and that worked for you here!

Some information for you:

Server configuration properties docuement is found here: http://download.microsoft.com/download/4/f/8/4f8f2dc9-a9a7-4b68-98cb-163482c95e0b/SSASProperties.doc

Project REAL implementation references have a lot of useful information: http://www.microsoft.com/sql/solutions/bi/projectreal.mspx

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