Skip to Content

Return the second value on a list SAP BO Report

Hi all,

I need a variable/function which can return the second value on a list.

For instance, when I need the first value (in this specific case it'll be the first week of the year when I have productions of a specific material), I use this function: Min([Week -year]) In ([Material - Key].


And now, what should I use for the second value (second week of production of that material)?


Thank you!!

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • Apr 19 at 11:57 AM

    To return the 1st value, I know that the function Min() and the function First() are equivalent.

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 23 at 01:27 PM

    Is the Week / Year object simply the Week number (measure) object?

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 24 at 10:57 AM

    I one possible way of doing this (it is convoluted and i'm sure someone else will come up with something far more efficient)

    Query objects:

    Material Key (dimension)
    Amount
    Week No.

    1. I created a new variable [WK2] defined as a dimension using the formula =[Week No.]
    2. I then used the formula: =Rank([Week No.]) In([WK2]) ranks the week numbers by themselves.
    3. Next column : =Max(Rank([Week No.]) In([WK2])) - Rank([Week No.]) In([WK2]) This returns the highest ranked Week No. value (the
    lowest actual week number) and subtracts the week no. ranking value from it.
    The second lowest Week No. rank value will always return a value of 1 from this formula.

    4. I defined the formula in step 3 as a variable [Flag] it has to be a measure object.
    5. I then created another variable [F2] (defined as a dimension) using the formula =[Flag]

    6. You can now filter on [F2] - select 1 from the list of values.

    Add comment
    10|10000 characters needed characters exceeded

  • May 08 at 02:08 PM

    Thank you, James,

    The problem here is I don't have production with a specific material every week, so I don't need the needs from the Week 2, what I really need is the needs (by needs I mean qtt of material consumption) on the second week of production. So, it's like the second value on a list.

    Am I being clear? :S

    Thank you

    Add comment
    10|10000 characters needed characters exceeded

  • May 08 at 02:08 PM

    Thank you, James,

    The problem here is I don't have production with a specific material every week, so I don't need the needs from the Week 2, what I really need is the needs (by needs I mean qtt of material consumption) on the second week of production. So, it's like the second value on a list.

    Am I being clear? :S

    Thank you

    Add comment
    10|10000 characters needed characters exceeded