In a SSAS 2005 cube.

I have a product dimension, it has a attribute: sp (selling price)

I want to list the sp along with other facts for products. But the query below returns null for sp. Idea?

        with member [measures].[sp] as
        [Products].[Current Sp].currentmember

        select {
            [Measures].[Sold value]
            , [measures].[sp]
            } on 0
        ,
        nonempty(
            {[Sales order details].[Receipt No].[Receipt No].allmembers}
            *{[Sales order details].[Line No].[Line No].allmembers}
            *{[Products].[Product code].[Product code].allmembers}
            , [Measures].[Sold value]
        ) on 1
        from (
            select [Time].[Day].&[20140430] on 0 from (
                select [Branch].[Branch].&[2] on 0 from (
                    select [Sales order details].[Receipt No].[680207] on 0 from [Rmis]
                ) 


            )
        )

enter image description here

update:

this is the final working query. I added [Products].[SKU].[SKU] because otherwise Current Sp returns 'All' (the null in original question is because of not using .Member_value). Current Sp and Product code are not related while they both related to [Products].[SKU].

        with member [measures].[sp] as
                [Products].[Current Sp].currentmember.MEMBER_value

                select {
                    [Measures].[Sold value]
                    , [measures].[sp]
                    } on 0
                ,
                nonempty(
                    {[Sales order details].[Receipt No].[Receipt No].allmembers}
                    *{[Sales order details].[Line No].[Line No].allmembers}
                    *{[Products].[Product code].[Product code].allmembers}
                    *{[Products].[SKU].[SKU]}
                    , [Measures].[Sold value]
                ) on 1
                from (
                    select [Time].[Day].&[20140430] on 0 from (
                        select [Branch].[Branch].&[2] on 0 from (
                            select [Sales order details].[Receipt No].[680207] on 0 from [Rmis]
                        ) 


                    )
                )
有帮助吗?

解决方案

with member [measures].[sp] as
     [Products].[Current Sp].CurrentMember.MemberValue

very close...just need to specify which property to display

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top