Showing posts with label types. Show all posts
Showing posts with label types. 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.

Thursday, March 8, 2012

Custom Filter for .msg files

I have an app that is automatically storing e-mails from Outlook in an image
field in SQL 2000. I have found where certain types of files have built in
filter support for searching, but .msg is not included as one of these.
Is anyone aware of anyway to do searches on the .msg file type within SQL.
BOL references the ability to create custom filters, but I am unable to find
the reference.
TIA,
J. Clay
did you try the following?
open up hkey_classes_root, locate msg, add a sub key to .msg called
PersistentHandler, add a string value called (Default)
with the value {5645C8C2-E277-11CF-8FDA-00AA0X0A14F93}
this uses mimefilt.dll which should be on most modern os's - win2k and
above.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"J. Clay" <JClay@.NoSpam.nospam> wrote in message
news:ew8U6WNUFHA.628@.TK2MSFTNGP09.phx.gbl...
> I have an app that is automatically storing e-mails from Outlook in an
image
> field in SQL 2000. I have found where certain types of files have built
in
> filter support for searching, but .msg is not included as one of these.
> Is anyone aware of anyway to do searches on the .msg file type within SQL.
> BOL references the ability to create custom filters, but I am unable to
find
> the reference.
> TIA,
> J. Clay
>
>
|||No. (Wouldn't have known how!) I will give it a try though and report
back.
Thank you very much!
Jim
"Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
news:O$osm5NUFHA.3280@.TK2MSFTNGP09.phx.gbl...[vbcol=seagreen]
> did you try the following?
> open up hkey_classes_root, locate msg, add a sub key to .msg called
> PersistentHandler, add a string value called (Default)
> with the value {5645C8C2-E277-11CF-8FDA-00AA0X0A14F93}
> this uses mimefilt.dll which should be on most modern os's - win2k and
> above.
> --
> Hilary Cotter
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
> Looking for a FAQ on Indexing Services/SQL FTS
> http://www.indexserverfaq.com
> "J. Clay" <JClay@.NoSpam.nospam> wrote in message
> news:ew8U6WNUFHA.628@.TK2MSFTNGP09.phx.gbl...
> image
> in
SQL.
> find
>
>
|||Actually MIME IFilter is capable of extracting text, but it does not deal
with attachments. In order to have full access to the information inside
..msg file I suggest using MSG IFilter, developed by Alna:
http://www.alna.com/vid.php4?mid=93&cat_id=4&prod_id=2.
Best regards,
Michailas
"J. Clay" <JClay@.NoSpam.nospam> wrote in message
news:OTUOX9NUFHA.3596@.TK2MSFTNGP14.phx.gbl...
> No. (Wouldn't have known how!) I will give it a try though and report
> back.
> Thank you very much!
> Jim
> "Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
> news:O$osm5NUFHA.3280@.TK2MSFTNGP09.phx.gbl...
> SQL.
>
>
|||Thanks Michailas - I think that is what I am looking for. I will make some
inquiries.
Regards,
Jim
"MT" <mtraubas@.alna.lt> wrote in message
news:%23E4qd1hUFHA.3716@.TK2MSFTNGP12.phx.gbl...[vbcol=seagreen]
> Actually MIME IFilter is capable of extracting text, but it does not deal
> with attachments. In order to have full access to the information inside
> .msg file I suggest using MSG IFilter, developed by Alna:
> http://www.alna.com/vid.php4?mid=93&cat_id=4&prod_id=2.
> Best regards,
> Michailas
>
> "J. Clay" <JClay@.NoSpam.nospam> wrote in message
> news:OTUOX9NUFHA.3596@.TK2MSFTNGP14.phx.gbl...
an[vbcol=seagreen]
these.[vbcol=seagreen]
to
>
>

Custom Export Format List in Rendered ReportViewer Control...

I know that at the server level you can suppress the export types that
appear in the export format list control when a report is rendered. Some of
my reports need to only display a subset of the server defined export types.
An example would probably best help in my issue... I need to display one
report with options to export being Excel and PDF. With another report I
need Excel and CSV. How can I set the export list control to only display
export types required for a specific report?
Thanks in advance.
--
Bob MorvayThat is not supported in the current product, it is controlled for the
entire app.
--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Bob Morvay" <adamantiumrocks@.hotmail.com> wrote in message
news:ejFlBLNeFHA.2664@.TK2MSFTNGP15.phx.gbl...
>I know that at the server level you can suppress the export types that
>appear in the export format list control when a report is rendered. Some
>of my reports need to only display a subset of the server defined export
>types. An example would probably best help in my issue... I need to
>display one report with options to export being Excel and PDF. With
>another report I need Excel and CSV. How can I set the export list control
>to only display export types required for a specific report?
> Thanks in advance.
> --
> Bob Morvay
>|||Well that sucks :) Thanks for responding.
"Wayne Snyder" <wayne.nospam.snyder@.mariner-usa.com> wrote in message
news:eaA4oEleFHA.2584@.tk2msftngp13.phx.gbl...
> That is not supported in the current product, it is controlled for the
> entire app.
> --
> Wayne Snyder, MCDBA, SQL Server MVP
> Mariner, Charlotte, NC
> www.mariner-usa.com
> (Please respond only to the newsgroups.)
> I support the Professional Association of SQL Server (PASS) and it's
> community of SQL Server professionals.
> www.sqlpass.org
> "Bob Morvay" <adamantiumrocks@.hotmail.com> wrote in message
> news:ejFlBLNeFHA.2664@.TK2MSFTNGP15.phx.gbl...
>>I know that at the server level you can suppress the export types that
>>appear in the export format list control when a report is rendered. Some
>>of my reports need to only display a subset of the server defined export
>>types. An example would probably best help in my issue... I need to
>>display one report with options to export being Excel and PDF. With
>>another report I need Excel and CSV. How can I set the export list
>>control to only display export types required for a specific report?
>> Thanks in advance.
>> --
>> Bob Morvay
>>
>