Skip to Content
avatar image
Former Member

Detecting week number


In one of our KFs, there is a requirement that the KF should behave in a certain way if First Week of the Year (ie Week 1) is encountered.

Is there any possible ways to make this work?Is there any way for keep track of week?



Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Dec 01, 2015 at 04:48 PM

    In backend or in Excel via local EPM key figure?

    In backend, it depends on how you created the PERIODID numbers for the week

    In Excel it depends on how you named the Period Description

    Assuming you mean backend, it works in principle:

    If for example you have weeks as lowest level and periodid for week 1/2015 would be 1000, 2/2015 = 1001, ... , 1/20016 = 1052, than you can check in your key figure formula on the PERIODCU and compare with the value "1052"

    Assuming you mean in Excel, you can check the cell, convert the header content into a text and check on that. How that could work completely depend on the way you named your weeks. If e.g. they are always starting with weeknumber and without leading zero (1/2015, 1/2016 1/2017...) than you can just take left of the cell with length 1 to check first week of the year

    Depending on the real requirement, solution in detail is a bit more complicated. This only gives a hint on how it works in principle

    I have done such checks both in backend key figure calculation as well as in excel, but for months

    Provide a more concrete example including your time profile values and what you really want to achieve before I can give more information



    Add comment
    10|10000 characters needed characters exceeded

    • Dear Saabri

      yes, logic could be like that with check on $$PERIODIDCU$$

      Surely you need to think about some logic to have that rolling, especially as you dont have 52 weeks every year.

      With months that is easier. Just to give you an idea, I was able to make a check like this:

      ($PERIODIDCU$$ - 2000) % 12

      --> that gave me in my specific case the possibility to devide by 12 months and check the rest which than gives me the number of the month, but first I needed to substract 2000 as my first month had Period ID 2001

      So you may have need of some attribute you could check that tells you how many weeks your your year has or some other constant which could you grab and make your rolling logic depending on that value

      Kind regards


  • Dec 15, 2015 at 08:06 AM

    Dear Saabri

    if the question os answered, can you kindly close it please?

    Kind regards


    Add comment
    10|10000 characters needed characters exceeded