Showing posts with label build. Show all posts
Showing posts with label build. Show all posts

Monday, March 19, 2012

Custom Rollup Dimension for AVG

I am trying to build a dimension and a cube that contains a measure of Avg Family Size and a dimension that group different types of families into different categories.

The dimension is a parent-child type but the parent should be the AVG of all children instead of SUM.

I tried to use Custom Rollup feature in dimension (there are 2 places, one during the dimension setup in pop-up window, there is check box then to define with MDX or use a column with unitary operator.Another place is in dimension Properties after dimension is setup).I cannot get it to work no matter what I do in dimension with MDX.The cube display #ERR for each cell.

Also, on cube setup, measure setup has a property of Aggregation.It has SUM, MAX, MIN, COUNT, DISTINCT COUNT but just does not have AVG.

So far, the only way is to define a calc measure with such MDX:

IIF(IsLeaf([Test1].CurrentMemeber), [Measure].size, AVG([Test1].CurrentMember.Children, [Measuer].size) )

This is sort of awkward because it renders the original Measure useless.

Any ideas to do this directly in Dimension or in Mesaure? This is for AS 2000.

One of the standard way of doing an average in AS is to set up 2 measures, a SUM and a COUNT and then create a calculated measure for the average and set it up as the SUM / COUNT. If you don't need the original SUM and COUNT measures you can set their visible properties to false. This would create an average for a single measure.

If you had a lot of measures and they all have to be averaged you could try something like one the following which I think should work across all measures (but I have not tested it)

AVG([Test1].CurrentMember,1))

OR

SUM(descendants([Test1].CurrentMember,1))/COUNT(descendants([Test1].CurrentMember,1))

The descendants(<member>,1) will go down 1 level if there is one, otherwise it will return the member itself, which helps avoid the IIF(IsLeaf(...)) test. And not explicitly stating a measure *should* mean that the query will use the current measure context.

Sunday, March 11, 2012

Custom Query Designer

Hi,

I am trying to build queries dynamically through a custom interface very much the way Query Designer does. Looking at few of the posts and replies in the forums it seems that SMO does not facilitate building queries but just offers you the metadata of the relational objects.

Are there any other DLL's/API's available which anyone is aware of which faciliates this ?

Thanks

Sam

You could use ADO.NET and build the strings and execute that way.
Tim|||In short, no. There are 3rd party commercial query builder components out there though.

Friday, February 17, 2012

custom assembly in RS

I'm trying to create a DLL that I can use with:
A) an ASP ("classic" ASP, not .NET)
B) a Reporting Services Report (SQL 2000)
If I build it in VB6, it will work with ASP, but RS gives me the error
"...dll does not contain an assembly"
If I build it in VB.NET, it will work with RS, but ASP gives the error
"can't create activeX component". It WILL work with an ASP.NET page,
but ideally I do not want to rewrite my entire ASP site for .NET just
to make this work.
All that being said, is there any way to write a DLL that will work
for both?
Thanks in advance,
EricNo, there is not. At least not exactly. What you can do is create your
assembly and then create a wrapper for it for your ASP application.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
<c-eric.geil@.mci.com> wrote in message
news:4bb9bbd8-5047-4827-9212-e2a47fde8593@.72g2000hsu.googlegroups.com...
> I'm trying to create a DLL that I can use with:
> A) an ASP ("classic" ASP, not .NET)
> B) a Reporting Services Report (SQL 2000)
> If I build it in VB6, it will work with ASP, but RS gives me the error
> "...dll does not contain an assembly"
> If I build it in VB.NET, it will work with RS, but ASP gives the error
> "can't create activeX component". It WILL work with an ASP.NET page,
> but ideally I do not want to rewrite my entire ASP site for .NET just
> to make this work.
> All that being said, is there any way to write a DLL that will work
> for both?
> Thanks in advance,
> Eric|||Can you post an example of this?|||I have not had to do it. I just know it is possible. Especially if
non-visual. Gooble: com interop dotnet vb6
or Google: dotnet dll wrapper
The second search returned lots of good links.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
<c-eric.geil@.mci.com> wrote in message
news:3c85e1da-f197-4907-9c6d-d509cca2216a@.i12g2000prf.googlegroups.com...
> Can you post an example of this?