Showing posts with label cube. Show all posts
Showing posts with label cube. Show all posts

Thursday, March 29, 2012

Determine status of processing cube

From C# I need to determine if a cube is currently processing. We are trying to avoid running MDX against a cube while in the act - it results in an error message to our users.

Does anybody know of a way to do this? Maybe with AMO?

Thanks in advance,

John

Hello John,

There is no easy way of doing this in AMO, but you could use the DISCOVER_LOCKS schema rowset to test whether there are write locks on your cube. The LOCK_STATUS and LOCK_TYPE fields returned by this discover could help you find this out.

Hope this helps,

Artur

Thursday, March 22, 2012

Detecting processing in progress

Is there an easy way through AMO to detect whether a cube (or database, or dimension...) is currently being processed?

I've tried registering for trace events, but that doesn't seem to be a very reliable way to detect an in-progress process - the gap between events are unknown, so I don't know how long I would need to listen for an event to be able to say definitively that something is being processed. Any other ideas?

I'm not aware of anyway of doing this. You can use performance counters to see if *something* is processing, but you can't see which object. You can use AMO to see when something was last processed, or if it is unprocessed and needs re-processing. But I can't see anything that would tell you if anything is currently being processed. Tracing seems to be one of the only ways of doing this, but you would almost need to write a service that could watch for the start, stop or cancelling of processing jobs in order to be able to figure this out reliably.

To look at this from another angle - why do you need to know? If something is already being processed, I would expect you should get a meaningful error stating this if you tried to process it again. And in most cases, end users should not care that something is being processed, they will just see the new data once the processing transaction has been committed.

|||Darren,
Knowing that *something* is processing is actually good enough for our needs right now. Perfmon counters are a great suggestion - I didn't think to look there. Processing Pool Busy threads seems accurate enough for our needs. I wish there were a counter for "Active Transaction", which would be even more useful for us, but it doesn't look like there is.

Our needs are somewhat unusual - we've actually built a product on SSAS, and our QA department needs to know when processing is in progress to avoid stepping on each other's toes while testing. I think you've given me what I need for now. Thanks!
|||

Well if you use a certain userid (ESP, SQLSERVER, or make a unique one) for processing, you could use the XMLA Discover command for DISCOVER_SESSIONS. If the userid is returned, something is processing.

We do something similiar. All jobs that process any cube use a specific userid.

|||

Yeah, DISCOVER_SESSIONS would be useful, there is also DISCOVER_TRANSACTIONS that might be worth a look.

<Discover xmlns="urnTongue Tiedchemas-microsoft-com:xml-analysis">

<RequestType>DISCOVER_TRANSACTIONS</RequestType>

<Restrictions>

<RestrictionList></RestrictionList>

</Restrictions>

<Properties>

<PropertyList></PropertyList>

</Properties>

</Discover>

|||Thanks fellas. I think between DISCOVER_TRANSACTIONS and DISCOVER_SESSIONS I've got the info I need.

Wednesday, March 21, 2012

Detect and Passing measure name in Action

Is there a way when launching action to call a URL, I can pass the name of the measure select by users?

We have a cube with multiple measures (included calculated member measures), when a user select a cell under measure A, I need to pass the name A to the URL to ASP.NET application. Similarly, when a user click measure B cell to fire up action, I need to pass measuer name B on URL the the web applicatoin.

Currently, I can pass dimension CurrentMember w/o problem, is there a similar measure CurrentMember function I can use?

Thanks!

CurrentMember should work on the Measures dimension in exactly the same way as on other dimensions, so by using something like Measures.CurrentMember.Name you should be able to get hold of the name of the current measure. Using the UrlEscapeFragment function (see http://cwebbbi.spaces.live.com/blog/cns!7B84B0F2C239489A!517.entry) will get rid of any url-unfriendly characters.

Chris

Saturday, February 25, 2012

Designing Date and Time Dimension

I need to display reports based on an SSAS cube which requires both date and time as input parameters.

I'd like to know what is the best practice while designing dimensions in such a scenario. Do i need to design a separate dimension for date ( quarter, year, month, week, day) and time ( hour, minute, second) ?

Or will having just the date dimension with the date key pointing to the full datetime in the fact table suffice?

I guess there is no correct answer to this question, but in my opinion you should design two dimensions - one for the dates and one for the seconds (with related attributes, of course). If you put it all in one dimension, your time dimension would consist of 60 x 60 x 24 x 365 = 31,536,000 members for each year (!!!), whereas if you make two separate dimensions, you have a date dimension with 365 members for each year and a time dimension with 86,400 members (constant). This will be much more performant and simple to work with in most cases.

Designing Aggregations

Does anyone know of a way to copy aggregations in the BI Studio?

I know you can copy aggregations in management studio after the cube is deployed...

Trying to do it at design time.

Thanks

Mark

You can switch to the "Code View" in BI dev studio and copy following property

<AggregationDesignID>YourAggregationDesignHere</AggregationDesignID>

From one partition to another.

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

Designin and Processing Cubes

Does anyone have any best practices for processing cubes on a prod environment? If we have 1 server which we have the production cube on, what is the best way to get the changes into the production cube. I tried a backup and restore of the AS DB with no success. Should I just create the database on a dev server and keep prod and dev separate? Any assistance would HELP BIG TIME!!!

The ultimately the question is: what configuraion you can afford to have. The better practice many Analysis Services users have found is to have 2 servers: Staging and Production. You were to maintatain your production server for users to query and during late night you'd use Sychronization feature of Analysis Services to push a new state from the Staging server. On the Staging server you process updates into your dimensions and partitions, you do your backups and test whether the data is correct, you test your security in short you make sure you get your cubes ready before user can see them.

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

Friday, February 24, 2012

Design Question: Calculated Field

I'm trying to create an OLAP system using SQL Server 2000 Analysis
Services (AS). I want the AS cube to be based on a database with a
star schema.

I have a field called Ratio. The initial ratio value is based upon
this formula: (CurrentTimePeriodAmount -
PreviousTimePeriodAmount)/PreviousTimePeriodAmount. However, that
initial ratio can be manually overridden and replaced. Then the ratio
is used to calculate future Amounts.

Should I place that calculated Ratio field in the "source" database
design or should it be part of the Analysis Services cube?What you may want to consider instead of creating a new field in the
physical table, is to use a view with the calculation there. I am a
huge advocate of using views for fact tables for the reason you are
talking about below.

The problem is if the ratio is going to be replaced/overridden you
need to ask yourself do you need to create a new record for this
ration value so you can track the changes over time. Are these changes
going to be adhoc, if so does your front-end tool allow for this type
of What If Functionality. Things to ask yourself.

HTH
-todd

imani_technology_spam@.yahoo.com wrote in message news:<8be6e8.0402030738.213518f7@.posting.google.com>...
> I'm trying to create an OLAP system using SQL Server 2000 Analysis
> Services (AS). I want the AS cube to be based on a database with a
> star schema.
> I have a field called Ratio. The initial ratio value is based upon
> this formula: (CurrentTimePeriodAmount -
> PreviousTimePeriodAmount)/PreviousTimePeriodAmount. However, that
> initial ratio can be manually overridden and replaced. Then the ratio
> is used to calculate future Amounts.
> Should I place that calculated Ratio field in the "source" database
> design or should it be part of the Analysis Services cube?|||I want to be able to display an initial, calculated ratio. I also
want a seperate field for the user to type in a ratio. How could that
be implemented? Also, I'm considering using SQL Server Analysis
Services with some kind of MS Excel 2000 front end.

toddack@.hotmail.com (Todd) wrote in message news:<a4f4b945.0402031412.4c3173fd@.posting.google.com>...
> What you may want to consider instead of creating a new field in the
> physical table, is to use a view with the calculation there. I am a
> huge advocate of using views for fact tables for the reason you are
> talking about below.
> The problem is if the ratio is going to be replaced/overridden you
> need to ask yourself do you need to create a new record for this
> ration value so you can track the changes over time. Are these changes
> going to be adhoc, if so does your front-end tool allow for this type
> of What If Functionality. Things to ask yourself.
> HTH
> -todd
> imani_technology_spam@.yahoo.com wrote in message news:<8be6e8.0402030738.213518f7@.posting.google.com>...
> > I'm trying to create an OLAP system using SQL Server 2000 Analysis
> > Services (AS). I want the AS cube to be based on a database with a
> > star schema.
> > I have a field called Ratio. The initial ratio value is based upon
> > this formula: (CurrentTimePeriodAmount -
> > PreviousTimePeriodAmount)/PreviousTimePeriodAmount. However, that
> > initial ratio can be manually overridden and replaced. Then the ratio
> > is used to calculate future Amounts.
> > Should I place that calculated Ratio field in the "source" database
> > design or should it be part of the Analysis Services cube?

Tuesday, February 14, 2012

Design Aggregations using XMLA

How can I automate aggregation design of a cube in Analysis Services

using XMLA.

I tried following XMLA.

I am not getting any examples for XMLA for Aggregation

design, please help me

===================================================

<Execute xmlns="urn:schemas-microsoft-com:xml-analysis">

<Command>

<DesignAggregations>

<Object>

<DatabaseID>Adventure

Works DW</DatabaseID>

<CubeID>Adventure

Works</CubeID>

<MeasureGroupID>Internet

Sales</MeasureGroupID>

<PartitionID>Inernet_Sales_2001</PartitionID>

</Object>

<Time>10</Time>

<Steps>4</Steps>

<Optimization>30</Optimization>

<Storage>100</Storage>

<Materialize></Materialize>

<Queries></Queries>

</DesignAggregations>

</Command>

<Properties>

<PropertyList>

</PropertyList>

</Properties>

</Execute>

===================================================

Regards

SK

Here's a couple of scripts i was mucking around with. i've split them into 1, 2 and 3 (ie numbered in the orderr in which i ran them). They may give you some pointers to where you want to go.

Sorry about the formatting, i've just pasted them in here and it seems to go on forever.....

Script 1 - Create Aggregation Design for Measure Group --

<!--

XMLA_Creates_Aggregation_Design_for_Measure_Group

This script adds the aggregation design to the measure group

-->

<Create xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
<ParentObject>
<DatabaseID>Aggregation Testbed</DatabaseID>
<CubeID>Adventure Works</CubeID>
<MeasureGroupID>Internet Sales</MeasureGroupID>
</ParentObject>
<ObjectDefinition><AggregationDesign>

<ID>AggregationDesign 1</ID>

<Name>AggregationDesign 1</Name>

<!-- Parameterize the following element-->

<EstimatedRows>1013</EstimatedRows>

<!-- Load the dimensions and levels and level counts from the Cube_Levels table-->

<Dimensions>

<Dimension>

<CubeDimensionID>Order Date Key - Dim Time</CubeDimensionID>

<Attributes>

<Attribute>

<AttributeID>Date</AttributeID>

<EstimatedCount>1158</EstimatedCount>

</Attribute>

<Attribute>

<AttributeID>Calendar Year</AttributeID>

<EstimatedCount>4</EstimatedCount>

</Attribute>

<Attribute>

<AttributeID>Calendar Semester</AttributeID>

<EstimatedCount>7</EstimatedCount>

</Attribute>

<Attribute>

<AttributeID>Calendar Quarter</AttributeID>

<EstimatedCount>13</EstimatedCount>

</Attribute>

<Attribute>

<AttributeID>Calendar Month Number</AttributeID>

</Attribute>

<Attribute>

<AttributeID>Calendar Month Name</AttributeID>

<EstimatedCount>38</EstimatedCount>

</Attribute>

<Attribute>

<AttributeID>Fiscal Year</AttributeID>

<EstimatedCount>4</EstimatedCount>

</Attribute>

<Attribute>

<AttributeID>Fiscal Semester</AttributeID>

</Attribute>

<Attribute>

<AttributeID>Fiscal Quarter</AttributeID>

</Attribute>

<Attribute>

<AttributeID>Fiscal Month Number</AttributeID>

</Attribute>

<Attribute>

<AttributeID>Fiscal Month Name</AttributeID>

</Attribute>

</Attributes>

</Dimension>

<Dimension>

<CubeDimensionID>Ship Date Key - Dim Time</CubeDimensionID>

<Attributes>

<Attribute>

<AttributeID>Date</AttributeID>

<EstimatedCount>1158</EstimatedCount>

</Attribute>

<Attribute>

<AttributeID>Calendar Year</AttributeID>

<EstimatedCount>4</EstimatedCount>

</Attribute>

<Attribute>

<AttributeID>Calendar Semester</AttributeID>

<EstimatedCount>7</EstimatedCount>

</Attribute>

<Attribute>

<AttributeID>Calendar Quarter</AttributeID>

<EstimatedCount>13</EstimatedCount>

</Attribute>

<Attribute>

<AttributeID>Calendar Month Number</AttributeID>

</Attribute>

<Attribute>

<AttributeID>Calendar Month Name</AttributeID>

<EstimatedCount>38</EstimatedCount>

</Attribute>

<Attribute>

<AttributeID>Fiscal Year</AttributeID>

<EstimatedCount>4</EstimatedCount>

</Attribute>

<Attribute>

<AttributeID>Fiscal Semester</AttributeID>

</Attribute>

<Attribute>

<AttributeID>Fiscal Quarter</AttributeID>

</Attribute>

<Attribute>

<AttributeID>Fiscal Month Number</AttributeID>

</Attribute>

<Attribute>

<AttributeID>Fiscal Month Name</AttributeID>

</Attribute>

</Attributes>

</Dimension>

<Dimension>

<CubeDimensionID>Delivery Date Key - Dim Time</CubeDimensionID>

<Attributes>

<Attribute>

<AttributeID>Date</AttributeID>

<EstimatedCount>1158</EstimatedCount>

</Attribute>

<Attribute>

<AttributeID>Calendar Year</AttributeID>

<EstimatedCount>4</EstimatedCount>

</Attribute>

<Attribute>

<AttributeID>Calendar Semester</AttributeID>

<EstimatedCount>7</EstimatedCount>

</Attribute>

<Attribute>

<AttributeID>Calendar Quarter</AttributeID>

<EstimatedCount>13</EstimatedCount>

</Attribute>

<Attribute>

<AttributeID>Calendar Month Number</AttributeID>

</Attribute>

<Attribute>

<AttributeID>Calendar Month Name</AttributeID>

<EstimatedCount>38</EstimatedCount>

</Attribute>

<Attribute>

<AttributeID>Fiscal Year</AttributeID>

<EstimatedCount>4</EstimatedCount>

</Attribute>

<Attribute>

<AttributeID>Fiscal Semester</AttributeID>

</Attribute>

<Attribute>

<AttributeID>Fiscal Quarter</AttributeID>

</Attribute>

<Attribute>

<AttributeID>Fiscal Month Number</AttributeID>

</Attribute>

<Attribute>

<AttributeID>Fiscal Month Name</AttributeID>

</Attribute>

</Attributes>

</Dimension>

<Dimension>

<CubeDimensionID>Customer</CubeDimensionID>

<Attributes>

<Attribute>

<AttributeID>Full Name</AttributeID>

<EstimatedCount>18484</EstimatedCount>

</Attribute>

<Attribute>

<AttributeID>Country-Region</AttributeID>

<EstimatedCount>6</EstimatedCount>

</Attribute>

<Attribute>

<AttributeID>State-Province</AttributeID>

<EstimatedCount>71</EstimatedCount>

</Attribute>

<Attribute>

<AttributeID>City</AttributeID>

<EstimatedCount>587</EstimatedCount>

</Attribute>

<Attribute>

<AttributeID>Postal Code</AttributeID>

<EstimatedCount>646</EstimatedCount>

</Attribute>

<Attribute>

<AttributeID>Education</AttributeID>

</Attribute>

<Attribute>

<AttributeID>Email Address</AttributeID>

</Attribute>

<Attribute>

<AttributeID>Gender</AttributeID>

</Attribute>

<Attribute>

<AttributeID>Marital Status</AttributeID>

<EstimatedCount>4</EstimatedCount>

</Attribute>

<Attribute>

<AttributeID>Occupation</AttributeID>

<EstimatedCount>6</EstimatedCount>

</Attribute>

<Attribute>

<AttributeID>Phone</AttributeID>

</Attribute>

</Attributes>

</Dimension>

<Dimension>

<CubeDimensionID>Product</CubeDimensionID>

<Attributes>

<Attribute>

<AttributeID>Product Name</AttributeID>

<EstimatedCount>606</EstimatedCount>

</Attribute>

<Attribute>

<AttributeID>Product Line</AttributeID>

<EstimatedCount>4</EstimatedCount>

</Attribute>

<Attribute>

<AttributeID>Model Name</AttributeID>

<EstimatedCount>119</EstimatedCount>

</Attribute>

<Attribute>

<AttributeID>Subcategory</AttributeID>

<EstimatedCount>37</EstimatedCount>

</Attribute>

<Attribute>

<AttributeID>Category</AttributeID>

<EstimatedCount>4</EstimatedCount>

</Attribute>

<Attribute>

<AttributeID>List Price</AttributeID>

</Attribute>

<Attribute>

<AttributeID>Size</AttributeID>

</Attribute>

<Attribute>

<AttributeID>Weight</AttributeID>

</Attribute>

</Attributes>

</Dimension>

<Dimension>

<CubeDimensionID>Currency</CubeDimensionID>

<Attributes>

<Attribute>

<AttributeID>Currency</AttributeID>

<EstimatedCount>105</EstimatedCount>

</Attribute>

<Attribute>

<AttributeID>Currency Code</AttributeID>

</Attribute>

</Attributes>

</Dimension>

<Dimension>

<CubeDimensionID>Sales Reason</CubeDimensionID>

<Attributes>

<Attribute>

<AttributeID>Sales Reason</AttributeID>

<EstimatedCount>10</EstimatedCount>

</Attribute>

<Attribute>

<AttributeID>Sales Reason Type</AttributeID>

<EstimatedCount>3</EstimatedCount>

</Attribute>

</Attributes>

</Dimension>

<Dimension>

<CubeDimensionID>Internet Sales Order Details</CubeDimensionID>

<Attributes>

<Attribute>

<AttributeID>Sales Order Key</AttributeID>

<EstimatedCount>60398</EstimatedCount>

</Attribute>

<Attribute>

<AttributeID>Sales Order Number</AttributeID>

<EstimatedCount>27659</EstimatedCount>

</Attribute>

<Attribute>

<AttributeID>Sales Order Line</AttributeID>

</Attribute>

<Attribute>

<AttributeID>Carrier Tracking Number</AttributeID>

</Attribute>

<Attribute>

<AttributeID>Customer PO Number</AttributeID>

</Attribute>

</Attributes>

</Dimension>

</Dimensions>

</AggregationDesign>

</ObjectDefinition>

</Create>

-- End of script 1 :)

Script 2. - Add/link the aggregation Design to the Measure Group --

<!--

XMLA_Adds_Aggregation_Design_To_Partition

This script adds the aggregation design to the partition. It requires the aggregation design to have been

created for the associated Measure Group

-->

<Alter xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">

<Object>

<DatabaseID>Aggregation Testbed</DatabaseID>

<CubeID>Adventure Works</CubeID>

<MeasureGroupID>Internet Sales</MeasureGroupID>

<PartitionID>Internet_Sales_914</PartitionID>

</Object>

<ObjectDefinition>

<Partition xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<ID>Internet_Sales_914</ID>

<Name>Internet_Sales_914</Name>

<Annotations>

<Annotation>

<Name>LastOrderDateKey</Name>

<Value>914</Value>

</Annotation>

</Annotations>

<Source xsi:type="QueryBinding">

<DataSourceID>AdventureWorksDW</DataSourceID>

<QueryDefinition>SELECT * FROM [dbo].[FactInternetSales] WHERE OrderDateKey &lt;= '184'</QueryDefinition>

</Source>

<StorageMode>Molap</StorageMode>

<ProcessingMode>Regular</ProcessingMode>

<ProactiveCaching>

<SilenceInterval>-PT1S</SilenceInterval>

<Latency>-PT1S</Latency>

<SilenceOverrideInterval>-PT1S</SilenceOverrideInterval>

<ForceRebuildInterval>-PT1S</ForceRebuildInterval>

<Source xsi:type="ProactiveCachingInheritedBinding" />

</ProactiveCaching>

<EstimatedRows>1013</EstimatedRows>

<AggregationDesignID>AggregationDesign 1</AggregationDesignID>

</Partition>

</ObjectDefinition>

</Alter>

-- END OF SCRIPT 2 :)

Script 3. - Run the designer to build the aggregation designs themselves (ie the aggregations, but not populated with data, this happens when you build the partition and/or cube).

<!--

XMLA_Runs_Aggregation_Engine_to_Determine_Aggregations

This script runs the aggregation engine that uses the supplied parameters to build an aggregation design

-->

<DesignAggregations xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">

<Object>

<DatabaseID>Aggregation Testbed</DatabaseID>

<CubeID>Adventure Works</CubeID>

<MeasureGroupID>Internet Sales</MeasureGroupID>

<AggregationDesignID>AggregationDesign 1</AggregationDesignID>

</Object>

<!--Time>00h00m05s</Time-->

<Steps>0</Steps>

<Optimization>25.0</Optimization>

<Materialize>true</Materialize>

</DesignAggregations>

-- END OF SCRIPT 3 :)

Hope you find these of use.

Steve.