cancel
Showing results for 
Search instead for 
Did you mean: 

MDX for creating a keyfigure

Former Member
0 Kudos

Hi all,

I need help on writting MDX to create my own keyfigure on the universe. The key figure has to be created using existing keyfigure in the universe but with restriction on version or value type etc. Any help regarding this is appreciated.

Thanks,

Hema

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello All,

In regards to the above question I have created a keyfigure but I am having difficulty with MDX syntax, any help in correcting this is greatly appreciated.

The below listed expression works fine,

SELECT: <EXPRESSION>(@Select(Sales\Sales))</EXPRESSION>

WHERE: <FILTER KEY="[0VERSION].[LEVEL01]">

<CONDITION OPERATORCONDITION="Equal">

<CONSTANT NAME="10"/>

</CONDITION></FILTER>

But when I try to include another filter, it throws an error,

SELECT: <EXPRESSION>(@Select(Sales\Sales))</EXPRESSION>

WHERE: <FILTER KEY="([0VERSION].[LEVEL01] , [0CURTYPE].[LEVEL01])">

<CONDITION OPERATORCONDITION="Equal">

<CONSTANT NAME="(10,10)"/>

</CONDITION></FILTER>

Thanks,

Hema

Former Member
0 Kudos

you can create a filter expression as:


<OPERATOR VALUE=AND> 
    <FILTER "0VERSION.LEVEL01">    (Object's Exact Definition)
        <CONDITION OPERATORCONDITION="Equal">
           <CONSTANT CAPTION=10>
           </CONSTANT>
        </CONDITION>
    </FILTER>
    <FILTER "0CURTYPE.LEVEL01">     (Object's Exact Definition)
         <CONDITION OPERATORCONDITION="Equal">
            <CONSTANT CAPTION=10>
            </CONSTANT>
        </CONDITION>
     </FILTER>
</OPERATOR>

Regards,

Rohit

Edited by: rohit12 on Sep 18, 2009 10:58 AM

Former Member
0 Kudos

Hi,

Writing a restricted key figure is easy using MDX. You don't have to write your expression in the same way you would have to do it using SQL.

So you don't have to create a filter or fill the where clause of the object.

The MDX syntax is like this:

<EXPRESSION>([measures].[measure definition], [dimension 1].[member uniquename], ... [dimension n].[member uniquename])</EXPRESSION>

So in your case, the syntax will be:

<EXPRESSION>(@Select(Sales\Sales), [0VERSION].[10], [0CURTYPE].[10])</EXPRESSION>

Please check that unique name for the version an curtype is 10, otherwise replace by the correct value.

Regards,

Didier

Former Member
0 Kudos

Thanks for your help on this, but the above code doesnt work.

Former Member
0 Kudos

Didier,

Thanks for your suggetion. That solved my problem. I tried the same expression yesterday but didnt happen to use exact unique value for the object (for )version I was using "10" instead of "010") so it was throwing errors and I couldnt relate the error and was under assumption that I have to write a where clause instead. Thanks again for clarifying this.

Regards,

Hema

Former Member
0 Kudos

SELECT: <EXPRESSION>(@Select(Sales\Sales))</EXPRESSION>

WHERE: <FILTER KEY="0VERSION.LEVEL01">

<CONDITION OPERATORCONDITION="Equal">

<CONSTANT NAME="10"/>

</CONDITION></FILTER>

But when I try to include another filter, it throws an error,

SELECT: <EXPRESSION>(@Select(Sales\Sales))</EXPRESSION>

WHERE: <FILTER KEY="(0VERSION.LEVEL01 , 0CURTYPE.LEVEL01)">

<CONDITION OPERATORCONDITION="Equal">

<CONSTANT NAME="(10,10)"/>

</CONDITION></FILTER>

1) To simply you question, you used webi Variable to resolved

Answers (0)