on 04-27-2010 12:49 PM
Hi,
I want to get the top ten of
[Artikel].[Alle Artikel]
based on
[Measures].[Netto Umsatz]
.
I created an object (I named it RankTest ) in the universe and put the following code in the select part:
<EXPRESSION>Rank([Artikel].[Alle Artikel].CurrentMember,
Order([Artikel].[Alle Artikel].children, [Measures].[Netto Umsatz],
BDESC))</EXPRESSION>
I create a filter and put the following code in the where part:
<FILTER EXPRESSION="Rank([Artikel].[Alle Artikel].CurrentMember,
Order([Artikel].[Alle Artikel].children, [Measures].[Netto Umsatz], BDESC))">
<CONDITION OPERATORCONDITION="LessOrEqual">
<CONSTANT CAPTION="10"/></CONDITION></FILTER>
For the object RankTest I always get 0 back, so my ranking did not work.
Do you have any hints?
Thanks for helping
Kind regards
Jens
Hi,
I assume that you have selected "Artikel" characteristic in the query otherwise ithe expression won't work.
By the way the syntax is incorrect: currentmember expression works with a dimension or a hierarchy not with a member.
So correct the syntax and use the following expressions:
<EXPRESSION>Rank([Artikel].CurrentMember,
Order([Artikel].[Alle Artikel].children, [Measures].[Netto Umsatz],
BDESC))</EXPRESSION>
<FILTER EXPRESSION="Rank([Artikel].CurrentMember,
Order([Artikel].[Alle Artikel].children, [Measures].[Netto Umsatz], BDESC))">
<CONDITION OPERATORCONDITION="LessOrEqual">
<CONSTANT CAPTION="10"/></CONDITION></FILTER>
Didier
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Didier,
now I get data back, but the statement runs for 2,5 hours!
In the Select part I use:
<EXPRESSION>
Rank([Artikel].[Alle Artikel].CurrentMember,
Order([Artikel].[Alle Artikel].currentmember.level.members,
[Measures].[Netto Umsatz], BDESC)
)
</EXPRESSION>
In the Filter I use:
<FILTER EXPRESSION=
"Rank([Artikel].[Alle Artikel].CurrentMember,
Order([Artikel].[Alle Artikel].currentmember.level.members,
[Measures].[Netto Umsatz], BDESC)
)"
><CONDITION OPERATORCONDITION=
"LessOrEqual"><CONSTANT CAPTION="10"/>
</CONDITION></FILTER>
In the query I use the Filter, the KIP and Ast Artikel ID
The generated MDX Code is:
WITH MEMBER [Measures].[65407E0E-3F18-42FA-A8,83,83,E3,DA,30,48,2] AS
Rank([Artikel].[Alle Artikel].CurrentMember,
Order([Artikel].[Alle Artikel].currentmember.level.members, [Measures].[Netto Umsatz], BDESC))
SELECT { [Measures].[65407E0E-3F18-42FA-A8,83,83,E3,DA,30,48,2] } ON COLUMNS ,
NON EMPTY FILTER( ADDCALCULATEDMEMBERS( [Artikel].[Artikel].[AST ARTIKEL ID].MEMBERS ) ,
[Measures].[65407E0E-3F18-42FA-A8,83,83,E3,DA,30,48,2] <= 10)
DIMENSION PROPERTIES MEMBER_UNIQUE_NAME, MEMBER_CAPTION ON ROWS
FROM [VE_UMSATZ]
If we use a different syntax, we get the answer in a few seconds.
Any hints?
Kind Regards
Jens
Hi,
What is the differnt syntax you mention? Can you provide a sample?
In XI 3.x we only support calculated measures whereas in XI 4.0 we will support calculated measures, calculated members and named sets that offer much more
capabilities.
Moreover the MDX generation has completely been redeveloped and improved. Last we do not aither flatten data.
See in attachment documents with MDX usage recomendations for more performance.
Regards
Didier
Hi Didier,
the generated snytax from Universe is this:
WITH MEMBER [Measures].[65407E0E-3F18-42FA-A8,83,83,E3,DA,30,48,2] AS
Rank([Artikel].[Alle Artikel].CurrentMember,
Order([Artikel].[Alle Artikel].currentmember.level.members, [Measures].[Netto Umsatz], BDESC))
SELECT { [Measures].[65407E0E-3F18-42FA-A8,83,83,E3,DA,30,48,2] } ON COLUMNS ,
NON EMPTY FILTER( ADDCALCULATEDMEMBERS( [Artikel].[Artikel].[AST ARTIKEL ID].MEMBERS ) ,
[Measures].[65407E0E-3F18-42FA-A8,83,83,E3,DA,30,48,2] <= 10)
DIMENSION PROPERTIES MEMBER_UNIQUE_NAME, MEMBER_CAPTION ON ROWS
FROM [VE_UMSATZ]
It take 2,5 hours to run.
The "normal" syntax for MSAS is the following one:
with set [Items] as
order ([Artikel].[Alle Artikel].children,
([Measures].[Measures].[Netto Umsatz]),
BDESC
)
member [measures].[rank] as
rank ([Artikel].[Alle Artikel].currentmember,
[Items]
)
select [Items] on 1,
{[Measures].[rank],[Measures].[Netto Umsatz] } on 0
from VE_Umsatz
It takes 6 seconds to run.
So, you can see we have the problem with "rank". The problem is also described in the document you provided. The question now is, what can we do to bring the universe to create the second (performance) syntax?
Kind Regards
Jens
Edited by: Jens Hafft on May 25, 2010 10:49 AM
Hi,
As I mentioned in my previous answer we don't support Sets in XI 3.X. We will support Sets in XI 4.0.
As far I can see, you are using a filter in the fist expression to only retrieve the top 10 whereas you don't filter in the second expression and retrieve all members with their rank.
So based on the definition you provided, can you test this expression. Create a calculated measure but don't create a predefined filter:
Rank([Artikel].[Alle Artikel].CurrentMember, Order([Artikel].[Alle Artikel].children, [Measures].[Netto Umsatz], BDESC))
Tell me if it solves the preformance problem.
Regards
Didier
Hi,
take a look at this article - it has some examples:
Ingo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.