0

Choose an specific dimension element

I'm trying to apply different data points depending on the element value.  this is how i built my formula:

if(CurrentMember([CalendarioMO].[date full month name]) = DateFormat(Date(),"MMM yyyy"),([measures].[ReporteTotal venta],[CalendarioMO].[date full month name].Lag(1), [CalendarioMO].[FiltroSellout].[S]),([measures].[ReporteTotal venta],[CalendarioMO].[date full month name].lag(1)))

Separate each data point works fine but the current member function does not get me the value of the dimension. Can anyone tell me which function does that?

My goal is to apply the first data point if my dimension "date full month name" is the current month, an the other one when it isn't.

2 replies

null
    • Senior Director of Product
    • Ian_Macdonald
    • 7 mths ago
    • Reported - view

    Hi 

    You need to add the caption() function to retrieve the string the represents the Member's caption (i.e. the string that appears in the column or row header when that member is present on a matrix grid) in order to test it against your generated string from today's date. Simply referring to currentmember() will return the default measure value for that member, without any other context.

    So you code becomes, using the dot notation:

    if(CurrentMember([CalendarioMO].[date full month name]).caption = DateFormat(Date(),"MMM yyyy"),([measures].[ReporteTotal venta],[CalendarioMO].[date full month name].Lag(1), [CalendarioMO].[FiltroSellout].[S]),([measures].[ReporteTotal venta],[CalendarioMO].[date full month name].lag(1)))

    Hope that helps.

    Ian

      • Friedrich_Schmid
      • 7 mths ago
      • Reported - view

       Thanks Ian, it hellped a lot.

Content aside

  • Status Answered
  • 7 mths agoLast active
  • 2Replies
  • 35Views
  • 2 Following