cancel
Showing results for 
Search instead for 
Did you mean: 

Detecting week number

Former Member
0 Kudos

Hi,

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?

Regards,

Saabitri

Accepted Solutions (1)

Accepted Solutions (1)

Irmi_Kuntze
Advisor
Advisor
0 Kudos

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

Yours

Irmi

Former Member
0 Kudos

Thanks Irmi, for this clarifiacation,

I was asking about the back-end.

Could you please confirm if you want me to do something similar to following in the system?

KF1@PL=IF($$PERIOIDCU$$=1052,KF2@PL,KF3@PL)

Considering 1052 to be the first week of 2016.

Regards,

Saabitri

Irmi_Kuntze
Advisor
Advisor
0 Kudos

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

Irmi

Answers (1)

Answers (1)

Irmi_Kuntze
Advisor
Advisor
0 Kudos

Dear Saabri

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

Kind regards

Irmi