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

Thursday, March 22, 2012

Easiest way to start and read a trace from within a SSIS package

I'm trying to gather information from within a SSIS package for benchmarking, reconciliation, and reporting purposes in regards to cube processing, which I'm initiating using the AS processing task.

What is the easiest way to capture this information?

The only way I've been able to come up with is to use a profiler trace. If this is really the only way, what is the easiest way to execute and read the trace from within SSIS?

Also, if a script task has to be used, does anyone have a code sample?

Thanks in advance!

Simplest way is to read the trace into SQL server. You can use the fn_trace_gettable to either populate a new table or return the data to SSIS by using an OLEDB source

see BOL ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/tsqlref9/html/c2590159-6ec5-4510-81ab-e935cc4216cd.htm

|||Thanks for the help! It looks like that may work. I'll give it a shot.

Thanks again.

Wednesday, March 21, 2012

Dynamix mdx query

I'm not to familiar with mdx, so I don't manage to create a dynamix mdx query in RS against my AS cube. What I'm looking for is having two parameters @.par1 and @.par2 that decide what dimensions to query against. The default query I get when I create a mdx with designer looks like the one below. The problem is that instead of [Product].[Product].[Product] and [Supplier].[Supplier].[Supplier] I would like to use my parameters. The parameters can contain the value Supplier, Product, Customer and all other names of the valid dimensions.I thought maybe it was possible to do somthing like this: [@.par1].[@.par1].[@.par1], but that didnt work :-) I have also tryed using with and set, but havnt managed to make it work. I have seen a couple examples on the forum that I didnt manage to use (http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=443401&SiteID=1, http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=520011&SiteID=1, http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=766277&SiteID=1), but I think these are mostly working with mesures not dimensions.SELECT

NON EMPTY

{

[Measures].[Amount]

}

ON COLUMNS,

NON EMPTY

{

([Product].[Product].[Product].ALLMEMBERS *

[Supplier].[Supplier].[Supplier].ALLMEMBERS)

}

DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS FROM [Purchase]

CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGSAny sugestions how to solve my problem?

Starting to get a bit desperat with this problem.

I don't manage to use parameters in my MDX query. I have added them in the parameter in the settings of the dataset, but it doesnt help. In regular SQL's it is very easy but I have problem seeing what wrong in the MDX.

Hopefully somone have the answer

|||

Shamefull *bump*

Do really no one know hwo to do this?

|||

It is possible. You need to use the StrToSet function.

SELECTNON EMPTY

{

[Measures].[Amount]

}

ON COLUMNS,NON EMPTY

StrToSet("[" + @.prm1 + "].[" + @.prm1 + "].[" + @.prm1 "].ALLMEMBERS")
*
StrToSet("[" + @.prm2 + "].[" + @.prm2 + "].[" + @.prm2 "].ALLMEMBERS")

DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS FROM [Purchase]

CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS

|||

Adam Tappis - IMGroup wrote:

It is possible. You need to use the StrToSet function.

SELECTNON EMPTY

{

[Measures].[Amount]

}

ON COLUMNS,NON EMPTY

StrToSet("[" + @.prm1 + "].[" + @.prm1 + "].[" + @.prm1 + "].ALLMEMBERS")
*
StrToSet("[" + @.prm2 + "].[" + @.prm2 + "].[" + @.prm2 + "].ALLMEMBERS")

DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS FROM [Purchase]

CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS

Thanks alot for the reply! I'm really desperate

It seems I'm closer to a solution but still have one problem. I get the following error message:

Query preparation failed.

Parser: The query contains the pmr1 parameters, wich is not declared.

I tryed to add the parameters manually in the parameters tab in the dataset information tab, but that didnt help. Usally when working with SQL and procedures they usally manage to populate the parameter list them self. I probably need to declare the variables directly in the mdx window. Tryed a couple of combinations using WITH and SET, but didnt really manage to get it to work.

Any more help would be really apreciated!

|||

There's 2 places you need to check:

1. Report Menu -> Report Parameters
Make sure the paramter exists (without the @. sign). This should be enough to run the report and look at it in the preview tab

2. In the Data view, click the button that has an @. sign on the dataset window toolbar
This is where you define values for the parametrs used in the query that will be used when you execute the query in this view. Add the parameter (without the @. sign) and specify a value for it.

Clicking the execute button in the toolbar should show you the results.

Hope this helps.

|||

Adam Tappis - IMGroup wrote:

There's 2 places you need to check:

1. Report Menu -> Report Parameters
Make sure the paramter exists (without the @. sign). This should be enough to run the report and look at it in the preview tab

2. In the Data view, click the button that has an @. sign on the dataset window toolbar
This is where you define values for the parametrs used in the query that will be used when you execute the query in this view. Add the parameter (without the @. sign) and specify a value for it.

Clicking the execute button in the toolbar should show you the results.

Hope this helps.

Nr 1 I had done or else I couldnt add them in the details of the dataset. But I didnt notice the parameter button (nr2) the mdx bar! When I added the name with a default value it worked as I wanted it too! Thanks alot I for the help, your a life saver!

|||

Lol I was a bit too quick to say that the problem was solved! I still have problem getting it to work

The problem is when I add pmr1 to the mdx parameter field is that I have to set default value. But when I change this parameter in the report I get 0 result on the dimension. Since the names of the fields becomes the same as the default value I tryed to create a calculated field to get the data to the report and get the value for the calculated field like this: =Fields(Parameters!pmr1.Value).Value. But this also only work if I use the default values set in the mdx toolbar.

Not sure if what I write here is understandable, feel free to ask question if I didnt make clear my problem. Thanks.

|||

Adam Tappis - IMGroup wrote:

There's 2 places you need to check:

1. Report Menu -> Report Parameters
Make sure the paramter exists (without the @. sign). This should be enough to run the report and look at it in the preview tab

2. In the Data view, click the button that has an @. sign on the dataset window toolbar
This is where you define values for the parametrs used in the query that will be used when you execute the query in this view. Add the parameter (without the @. sign) and specify a value for it.

Clicking the execute button in the toolbar should show you the results.

Hope this helps.

With regard to what I said before, doing number 1 will be enough to get this working if configured correctly.

Number 2 and the default value you define there is ONLY used when you want to preview the results of your query in the data tab and does not effect the report at run time e.g. through browser or preview tab. Only the parameter definition in the report parameters window effects run-time execution.

You shouldn't be using any expression syntax at all (unless you are connecting via OLEDB but let's not get into that)

Have are your parameters configured? Datatypes, options, values, manually defined or dataset driven?

|||

Hi, thanks for the response again.

I still have some problems getting it to work as explained. I'll try to give a bit more info.

If I only do 1. then I get error message when trying to leave the data tab becouse the "Query preparation failed". When I also do 2 it works fine but only with the default values I set as parameter on the mdx toolbar.

I have tryed creating the report parameters first and also tryed to let reporting services create the parameters when I add them in the mdx toolbar. No diffrence. Datype is string. No options set. I have tryed with values manually set and without any values. No diffrence.

Maybe there is a diffrence in version from the one I use and the one you use? My version of Reporting Services is 9.00.2047.00.

Any sugestions?

Monday, March 19, 2012

Dynamically setting maximum server date dimension

Hello everyone. I have what should hopefully be a simple problem. I have a fairly complicated cube created in SSAS 2005. One of my dimensions is a Server Time dimension. I have this linked to my fact table with a Regular relationship. Now, I would ideally like to be able to set the CalendarEndDate property in the Source property group of my dimension dynamically, based on the most recent date in the fact table. I will never need to see information for a future date using this dimension. Any ideas would be greatly appreciated. Thank you.

Alex Levin

Principal Consultant

Fifth Marker Consulting, LLC

alex.levin@.fifthmarker.com

Why would you want to do that? Which goals of yours would it allow to reach?|||

I have a cube which is being used by analysts who are using Excel pivottables as a frontend. When sorting by time, they do not wish to see any options which will return no data. New data is only added about once a month, so reprocessing the cube at that time is not an issue. Does this make sense? Is this the appropriate way of handling this situation?

Alex Levin

Principal Consultant

Fifth Marker Consulting, LLC

alex.levin@.fifthmarker.com

|||Usually the tools are capable to show only cells with data. For instance, Browser page in Visual Studio does not show the cells with no data by default. You can control it with "Show Empty Cells" button on the toolbar. I think Excel has the same functionality.

Suppose you have 2 measure groups. For one measure group the fact data gives you "last known date1", for another - "last known date2". What would you do?

The time span for the time dimension should cover all the facts with which the dimension will be used. Otherwise the processing of the cube will fail.|||

you can disable cells in excel where you do't have any data. in the Pivot table you have a button called "Always display items"

-- Good Luck

|||

Here is another way to skin the cat.

I have mutiple measure groups using the time dimension. The way I find the min and max dates is store them in a single record table DAY_DIM_RANGE using a stored procedure. This goes through the multiple fact tables and retains the min and max dates and writes them to the single row table.

The date dimension is then built using a view with a where clause such as

WHERE DAY_KEY BETWEEN (SELECT minDayKey FROM dbo.DAY_DIM_RANGE) AND
(SELECT maxDayKey FROM dbo.DAY_DIM_RANGE)

When you add additional measure groups, just adjust the stored procedure to handle the new fact table min and max dates. The view does not change. The stored procedure needs to run just before the cube is processed or at end of ETL.

Dynamically setting maximum server date dimension

Hello everyone. I have what should hopefully be a simple problem. I have a fairly complicated cube created in SSAS 2005. One of my dimensions is a Server Time dimension. I have this linked to my fact table with a Regular relationship. Now, I would ideally like to be able to set the CalendarEndDate property in the Source property group of my dimension dynamically, based on the most recent date in the fact table. I will never need to see information for a future date using this dimension. Any ideas would be greatly appreciated. Thank you.

Alex Levin

Principal Consultant

Fifth Marker Consulting, LLC

alex.levin@.fifthmarker.com

Why would you want to do that? Which goals of yours would it allow to reach?|||

I have a cube which is being used by analysts who are using Excel pivottables as a frontend. When sorting by time, they do not wish to see any options which will return no data. New data is only added about once a month, so reprocessing the cube at that time is not an issue. Does this make sense? Is this the appropriate way of handling this situation?

Alex Levin

Principal Consultant

Fifth Marker Consulting, LLC

alex.levin@.fifthmarker.com

|||Usually the tools are capable to show only cells with data. For instance, Browser page in Visual Studio does not show the cells with no data by default. You can control it with "Show Empty Cells" button on the toolbar. I think Excel has the same functionality.

Suppose you have 2 measure groups. For one measure group the fact data gives you "last known date1", for another - "last known date2". What would you do?

The time span for the time dimension should cover all the facts with which the dimension will be used. Otherwise the processing of the cube will fail.|||

you can disable cells in excel where you do't have any data. in the Pivot table you have a button called "Always display items"

-- Good Luck

|||

Here is another way to skin the cat.

I have mutiple measure groups using the time dimension. The way I find the min and max dates is store them in a single record table DAY_DIM_RANGE using a stored procedure. This goes through the multiple fact tables and retains the min and max dates and writes them to the single row table.

The date dimension is then built using a view with a where clause such as

WHERE DAY_KEY BETWEEN (SELECT minDayKey FROM dbo.DAY_DIM_RANGE) AND
(SELECT maxDayKey FROM dbo.DAY_DIM_RANGE)

When you add additional measure groups, just adjust the stored procedure to handle the new fact table min and max dates. The view does not change. The stored procedure needs to run just before the cube is processed or at end of ETL.

Sunday, March 11, 2012

Dynamically creating cube

Hi guys

I'm investigating whether if its possible to Dynamically create a cube. Then Process this cube before exporting it to a .cub file.

I know that DTS in sqlserver is able to process a cube given at a scheduled time interval. But I'm not sure how I can export a cube to a offline .cub file dynamically. The only way that i know to create a .cub file is via PivotTable in Excel.

Any help in pointing me to the right direction is appreciated.

Thankyou
TomCan you please explain the scenario where you think we may need such a functionality.|||The reason I ask is because I need to generate sales data to various company however each company requries different sets of cube data being generated. Where some should not see the sales figures of another company. As a result i need to generate this dynamic cube and have it filled and exported as a local cube so that it can be downloaded for offline browsing.

any idea how I can achieve this is appreciated?
Thanks
Tom|||Did you ever figure out how to do accomplish this?|||yes, using CREATE CUBE statment, and specify the path and it will create it automatically

Dynamically creating cube

Hi guys

I'm investigating whether if its possible to Dynamically create a cube. Then Process this cube before exporting it to a .cub file.

I know that DTS in sqlserver is able to process a cube given at a scheduled time interval. But I'm not sure how I can export a cube to a offline .cub file dynamically. The only way that i know to create a .cub file is via PivotTable in Excel.

Any help in pointing me to the right direction is appreciated.

Thankyou
TomCan you please explain the scenario where you think we may need such a functionality.|||The reason I ask is because I need to generate sales data to various company however each company requries different sets of cube data being generated. Where some should not see the sales figures of another company. As a result i need to generate this dynamic cube and have it filled and exported as a local cube so that it can be downloaded for offline browsing.

any idea how I can achieve this is appreciated?
Thanks
Tom|||Did you ever figure out how to do accomplish this?|||yes, using CREATE CUBE statment, and specify the path and it will create it automatically

Wednesday, March 7, 2012

Dynamically Add Partitions to a SSAS Cube

The environment here is SSIS ETL feeding a Fact Table. The Fact Table is pulled into SSAS as a cube and reporting services are handled there. I am on the ETL side and don't pretend to know all the processing that happens with cubes, etc.

What we are trying to accomplish is to add partitions to a Cube via the ETL processing. The partitions should be incremented by Day, i.e. 20070501, 20070502, etc.

This is currently processed manually by the Reporting developer and we are looking for an automated process to reduce errors and hand work.

I have explored the following objects: Partition Processing DataFlow Destination and did not find much documentation or examples on it's use. If you have any information on this stage, please reply with such.

The other option is the Analysis Services Processing Control Flow. I understand that we can process Analysis Server objects as part of our package. Is there a way to incorporate a Partitioning Script in this object? If so, how. Again, I did not find detailed examples on the use of this object.

If you have experience with either of these, please feel free to reply. I appreciate any and all comments.

Use the "Analysis Services Execute DDL Task". This allows you to fire XMLA statements against Analysis Services.

I can't help you with what the XMLA statement needs to be I'm afraid, you'll need to go for the Analysis Services forum for that.

You may wish to check out these two guys for assistance:

Darren Gosbel - http://geekswithblogs.net/darrengosbell/Default.aspx

Chris Webb - http://cwebbbi.spaces.live.com/

-Jamie

|||

Jamie, thanks I will explore this task...our SSAS developer is checking out how to generate the XML so I will forward these links to him. Our research was leading us toward the XMLA approach but we were lacking in how to fire it off.

Thanks again!

|||

I am also looking into this and have my xmla created and all, but when firing the task i get this error:

[Analysis Services Execute DDL Task] Error: Errors in the metadata manager. Either the cube with the ID of 'xxxx' does not exist in the database with the ID of xxxx', or the user does not have permissions to access the object.

Anyone can help with this error?

|||

Hi JOER_DK,

CUBE ID is nothing but the name of the cube you want to process from an Analysis Services Database. You can generate the code for processing a cube by right clicking the cube -> Process-> This open a window for processing -> In this window, you have a button to script out the xmla for processing.

Thanks

Subhash Subramanyam