Friday, March 30, 2012

named transaction

Hi,
I need to make sure i do not open second transaction if one is already
opened,
i wanted to name a transaction, but how can i cjeck if a transaction with
that name is already open?
mndreu
On Mon, 7 Feb 2005 09:20:43 +0100, Malgorzata Ndreu wrote:

>Hi,
>I need to make sure i do not open second transaction if one is already
>opened,
Hi mndreu,
Check @.@.TRANCOUNT.

>i wanted to name a transaction, but how can i cjeck if a transaction with
>that name is already open?
If @.@.TRANCOUNT is 0, no transaction at all is open.
If @.@.TRANCOUNT is > 0, I know of no way to check if the open transactions
are named and what their names are.
Best, Hugo
(Remove _NO_ and _SPAM_ to get my e-mail address)

Named subscription is greyed out

The system consists of one SQL 2000 Server (Distributor and Publisher) and
several subscribers running MSDE 2000 and Merge Replication. Every
Subscriber connects to the publisher using Pull Subscription, but the choice
of selecting "No, This is a named subscription" is grayed out when
establishing the subscription. I therefore have to pick Anonymous
subscription... Why?
You'll need to register the subscribers first.
With the MSDE subscriber connected to your publisher, in Enterprise Mgr:
right click Replication and select the Config. Publishers, Subscriber and
Distributors option. On the Subscribers tab, select the box next to the
Subscribers to register them. Enter the connecting account using the ...
button. Then re-create the pull subscription.
Had the same problem myself recently.
Steve Halfacre
Synapsis, UK
<hallvardsc@.hotmail.com> wrote in message
news:%23dPPwIeLEHA.340@.TK2MSFTNGP11.phx.gbl...
> The system consists of one SQL 2000 Server (Distributor and Publisher) and
> several subscribers running MSDE 2000 and Merge Replication. Every
> Subscriber connects to the publisher using Pull Subscription, but the
choice
> of selecting "No, This is a named subscription" is grayed out when
> establishing the subscription. I therefore have to pick Anonymous
> subscription... Why?
>
>
sql

Named sets and Existing

I have a very large Account dimension (> 2,000,000 members). I would like to create a named set for the top most profitable accounts. I plan to use this named set in the SSRS Report Builder to compensate for its lack of aTop N feature. The problem is that the user can change the fiscal period and SSAS needs to reevaluate the set. Using Generate function won't work for performance reasons. So, I'm trying to use Existing to force the set generation. e.g.

CREATE SET CURRENTCUBE.[Top 5 Profitable Accounts]

AS

Order(TopCount(

(EXISTING [Account].[Account].[Account].Members, [Period].[Period].CurrentMember), 5, [Measures].[Profit]),

[Measures].[Profit], DESC);

However, this gives me "The Period hierarchy already appears in the Axis1 axis." error when I test the set with the following query

select non empty [Measures].[Profit] on 0,

non empty [Top 5 Profitable Accounts] on 1

from [RPM]

WHERE [Period].[Period].&[20030228]

and duplicated dimensionality error in the Report Builder.

Does anyone know how this could be implemented?

There are a couple of issues in the Named Set:

The error can be eliminated by not explicitly specifying [Period].[Period].CurrentMember with Existing.|||

Deepak,

Thank you for helping. True, the modified set doesn't error out. However, as you pointed out, it is not dynamic. It only works with the default time period which is where I started. In other words, EXISTING doesn't help here. Changing the query slicer to a different time period doesn't produce any results. It looks like we cannot change the context of standard named sets defined with CREATE SET in the cube script. This pretty much leaves me with no options to simulate TopN with the Report Builder.

Named Sets

Hi,

I defined 2 Named Sets, so as to filter my calculated members:

NamedSet1:

{([Dimension1].[MyLevel1].&[X]),([Dimension1].[MyLevel1].&[Y']),([Dimension1].[MyLevel1].&[Z'])}

NamedSet2:

{([Dimension2].[MyLevel2].&[A']),([Dimension2].[MyLevel2].&[B']),([Dimension2].[MyLevel2].&[C'])}

It works well, but I didn't manage to use them in the same expression like

Sum(Crossjoin([NamedSet1],[NamedSet2], [Measures].[TurnOver]), the result is wrong.

Does anybody know how to do that ?

Regards

Ayzan

I wrote a short sample for you that works with Adventure Works. If this doesn't help, please, explain your scenario better, especially your calculations, expected result and actual result.

with
set set1 as '{ [Product].[Category].&[1], [Product].[Category].&[3] }'
set set2 as '{[Product].[Color].&[Black], [Product].[Color].&[White]}'
member x as 'sum(crossjoin(set1,set2), measures.[Customer Count])'
select x on 0 from [Adventure Works]

NAMED SET/ CALCULATED FIELDS

Hi,

Can I use the following MDX in named set/ calculated fields:

with member [MEASURES].[thisistheratio] as

([Direction].[Direction].&[1],[Measures].[Activity Count])/

([Direction].[Direction].[ALL],[Measures].[Activity Count]),

FORMAT="0%"

Select {[Measures].[Activity Count],

[MEASURES].[thisistheratio]} on columns,

{[Direction].[Direction].mEMBERS} on rows

FROM [CASEACTIVITYDETAIL]

how do I use it? Is there a particular syntax if you apply it inside named sets/calculated fields?

thanks a lot!

cherriesh wrote:

Hi,

Can I use the following MDX in named set/ calculated fields:

with member [MEASURES].[thisistheratio] as

([Direction].[Direction].&[1],[Measures].[Activity Count])/

([Direction].[Direction].[ALL],[Measures].[Activity Count]),

FORMAT="0%"

Select {[Measures].[Activity Count],

[MEASURES].[thisistheratio]} on columns,

{[Direction].[Direction].mEMBERS} on rows

FROM [CASEACTIVITYDETAIL]

how do I use it? Is there a particular syntax if you apply it inside named sets/calculated fields?

thanks a lot!

What you have there is an MDX query, you cannot put the whole thing inside a calculated member/set. I am guessing that what you probably want to do is to create a calculated measure for this ratio. If this is the case you could do either of the following.

If you open up your cube and click on the calculations tab, about the 4th button along the top will be an "New Calculated Member" button. When you click on this it brings up a form to let you add a new calculated member and you would fill out the following properties:

Name: [thisistheratio]

Parent Hierarchy: MEASURES

Expression:

([Direction].[Direction].&[1],[Measures].[Activity Count])/

([Direction].[Direction].[ALL],[Measures].[Activity Count])

Format String: "0%"

Alternatively you could switch to the script view and just paste in:

CREATE MEMBER CURRENTCUBE.Measure.[thisistheratio]

AS

([Direction].[Direction].&[1],[Measures].[Activity Count])/

([Direction].[Direction].[ALL],[Measures].[Activity Count]),

FORMAT="0%";

Named Set with TOPCOUNT Not Working Correctly

I need to create reports that contain our top 15 customers at any given point in time. I created the following Named Set using the TopCount function in SSAS 2005:

TOPCOUNT([Customer].[Customer Type-Name-Door Hierarchy].[Customer Name].members, 15, [Measures].[Net Ship Dollars])

When I bring this set into the client (Excel 2007 pivot table), its shows our top 15 customers for all time. When I add a date filter for just 2007, it doesn't update the list to just show the top customers for 2007. It just keeps the same "all time" group.

When I create this named set in a browser query, it works correctly. That is, it shows the top 15 customers for 2007. Is there any way I can get the Named Set created in SSAS to show the correct data based on the filtered date in the client?

Here is the browser query:

WITHSET

[Top Performers]

AS

'TOPCOUNT([Customer].[Customer Type-Name-Door Hierarchy].[Customer Name].members, 15, [Measures].[Net Ship Dollars])'

SELECT

{[Measures].[Net Ship Dollars]} ONCOLUMNS,

{[Top Performers]}ONROWS

FROM Shipments

Where ([Date].[Calendar Year].&[2007])

Thank you.

David

Are you using AS 2005 SP2? This problem has been fixed there.|||

The problem here is because the named set in the MDX Script gets resolved when it is first parsed at which time all the other dimensions will be set to their default members (which is usually the "All" member). Using the EXISTING statement in your set definition should force it to be re-evaluated with the current context each time it is used.

eg

TOPCOUNT(EXISTING [Customer].[Customer Type-Name-Door Hierarchy].[Customer Name].members, 15, [Measures].[Net Ship Dollars])

|||I am using SP2 but still experiencing the problem.|||

Darren,

I tried this but the same problem is occuring. Apparently, the default member of the time hierarchy determines what customer members to return. When I changed the default member to 2007, the named set showed the top customers for 2007. I came across another post which confirmed this as a problem. Does anybody have any workarounds? Thyank you.

David

|||

Hi David,

It seems that I did not read your full question and missed some information. So, just want to clarify. Named sets in AS 2005 are static named sets, which means that they are calculated just once in the context of the current member awailable at that moment. They are not reevaluated during execution of the select statement. Daren is right in the fact that named sets created in the cube scope or session scope (using Create statement) are evaluated when the CREATE statement is executed, therefore TopCount is calculated in the context of the default member. Sets created in the query scope using With clause are evaluated right after the WHERE clause and therefore take current member defined by the where clause in concideration (this is why your query with WITH statement works as you expect and query with named set from CREATE statement return different results). There are it's own pros on having static named sets (mostly performance), but in your case you should try to avoid using TopCount in the named set, if you want the members on other axis to affect results of the topcount.

Irina

P.S.

>>> I came across another post which confirmed this as a problem.

Could you please point me to this thread?

|||

Irina Gorbach wrote:

Named sets in AS 2005 are static named sets, which means that they are calculated just once in the context of the current member awailable at that moment. They are not reevaluated during execution of the select statement.

Of course! sorry for leading you slightly astray. The EXISTING statement will work if you have a set in a calculation

eg

CREATE MEMBER CurrentCube.Measures.CustomersInTop10Pcnt AS COUNT(TOPPERCENT(EXISTING Customer.Customer.Members, 150 Measures.Sales)

This would re-evaluate the set used in the toppercent function based on the current slicing conditions, which is similar, but different.

|||so is this the solution then?

TOPCOUNT(EXISTING [Customer].[Customer Type-Name-Door Hierarchy].[Customer Name].members, 15, [Measures].[Net Ship Dollars])

or is there another way?

Also, how do you get it to sort correctly in excel, if you pull over the named set it just shows you the top X sorted by the SET Expression, whereas if you do an MDX query it sorts it by the Numeric Expression

Named Set with TOPCOUNT Not Working Correctly

I need to create reports that contain our top 15 customers at any given point in time. I created the following Named Set using the TopCount function in SSAS 2005:

TOPCOUNT([Customer].[Customer Type-Name-Door Hierarchy].[Customer Name].members, 15, [Measures].[Net Ship Dollars])

When I bring this set into the client (Excel 2007 pivot table), its shows our top 15 customers for all time. When I add a date filter for just 2007, it doesn't update the list to just show the top customers for 2007. It just keeps the same "all time" group.

When I create this named set in a browser query, it works correctly. That is, it shows the top 15 customers for 2007. Is there any way I can get the Named Set created in SSAS to show the correct data based on the filtered date in the client?

Here is the browser query:

WITH SET

[Top Performers]

AS

'TOPCOUNT([Customer].[Customer Type-Name-Door Hierarchy].[Customer Name].members, 15, [Measures].[Net Ship Dollars])'

SELECT

{[Measures].[Net Ship Dollars]} ON COLUMNS,

{[Top Performers]}ON ROWS

FROM Shipments

Where ([Date].[Calendar Year].&[2007])

Thank you.

David

Are you using AS 2005 SP2? This problem has been fixed there.|||

The problem here is because the named set in the MDX Script gets resolved when it is first parsed at which time all the other dimensions will be set to their default members (which is usually the "All" member). Using the EXISTING statement in your set definition should force it to be re-evaluated with the current context each time it is used.

eg

TOPCOUNT(EXISTING [Customer].[Customer Type-Name-Door Hierarchy].[Customer Name].members, 15, [Measures].[Net Ship Dollars])

|||I am using SP2 but still experiencing the problem.|||

Darren,

I tried this but the same problem is occuring. Apparently, the default member of the time hierarchy determines what customer members to return. When I changed the default member to 2007, the named set showed the top customers for 2007. I came across another post which confirmed this as a problem. Does anybody have any workarounds? Thyank you.

David

|||

Hi David,

It seems that I did not read your full question and missed some information. So, just want to clarify. Named sets in AS 2005 are static named sets, which means that they are calculated just once in the context of the current member awailable at that moment. They are not reevaluated during execution of the select statement. Daren is right in the fact that named sets created in the cube scope or session scope (using Create statement) are evaluated when the CREATE statement is executed, therefore TopCount is calculated in the context of the default member. Sets created in the query scope using With clause are evaluated right after the WHERE clause and therefore take current member defined by the where clause in concideration (this is why your query with WITH statement works as you expect and query with named set from CREATE statement return different results). There are it's own pros on having static named sets (mostly performance), but in your case you should try to avoid using TopCount in the named set, if you want the members on other axis to affect results of the topcount.

Irina

P.S.

>>> I came across another post which confirmed this as a problem.

Could you please point me to this thread?

|||

Irina Gorbach wrote:

Named sets in AS 2005 are static named sets, which means that they are calculated just once in the context of the current member awailable at that moment. They are not reevaluated during execution of the select statement.

Of course! sorry for leading you slightly astray. The EXISTING statement will work if you have a set in a calculation

eg

CREATE MEMBER CurrentCube.Measures.CustomersInTop10Pcnt AS COUNT(TOPPERCENT(EXISTING Customer.Customer.Members, 150 Measures.Sales)

This would re-evaluate the set used in the toppercent function based on the current slicing conditions, which is similar, but different.

|||so is this the solution then?

TOPCOUNT(EXISTING [Customer].[Customer Type-Name-Door Hierarchy].[Customer Name].members, 15, [Measures].[Net Ship Dollars])

or is there another way?

Also, how do you get it to sort correctly in excel, if you pull over the named set it just shows you the top X sorted by the SET Expression, whereas if you do an MDX query it sorts it by the Numeric Expression
sql