Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: How to get current row value in a WITH MEMBER calculation ?

  1. #1

    Default How to get current row value in a WITH MEMBER calculation ?

    I would like to calculate a Measure based on the current row.
    Problem is I can't find a way to get the current row in a WITH MEMBER part.

    Code:
    WITH MEMBER [Measures].[Test] AS AVG(
    NonEmptyCrossJoin(
    	FILTER(DESCENDANTS([Exigences].[ENVGR], [Levier], SELF), [Exigences].CurrentMember.Name = 'Chemicals'),
    	DESCENDANTS([Organization].[Company].[Powertrain], [entity], SELF)),
    [Measures].[ProgressLevel])
    
    SELECT {[Measures].[ProgressLevel], [Measures].[Test]} ON COLUMNS,
    DESCENDANTS([Exigences].[ENVGR].[ENVGR-01.001], [Levier], SELF) ON ROWS
    FROM [Exigences]
    Chemicals (inside the WITH MEMBER part) is currently hard coded. That is for the example.
    I would like in place of 'Chemicals' to have the current row value.

    So let's say those are the values rows will return 'Chemicals', 'Pharmacy', 'Test', I would like the [Measures].[Test] calculation to change.

    Can MDX do that ? If so how can I get the current value.

    I tried [Levier].CurrentMember.Name but I think it's conflicting with the [Exigences].CurrentMember.Name.

    Any one has an idea ?

    Thank you,

    --
    Spredzy

  2. #2

    Default

    Solution encountered

    Using the pattern : [Dimension].CurrentMember in the WITH MEMBER calculation does what was asked.

    --
    Spredzy

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.