## Level 2 Sprint 3 SYS01 line items

Frequent Contributor

## Level 2 Sprint 3 SYS01 line items

I am struggling with the beginning inventory formula.  I feel confident with the later part of the formula but I don't see how I am going to rule out that it is the first week of the year.  Should I add a line item to my module?

3 ACCEPTED SOLUTIONS

Accepted Solutions
Master Anaplanner/Community Boss

## Re: Level 2 Sprint 3 SYS01 line items

Hello @LStinsa

You can programmatically determine the first period in your model (and the last period too). While there isn't a specific function to directly return this value, you can use a time series function
Some of the time series functions include a fill value parameter, which is basically a value the model builder specifies and expects it to be returned in case we reach the boundaries of the model timeline i.e. a period outside of the model's time range.
For example, you specify the fill value to -1 or 999 or any other value that you wouldn't get as a result of the function and compare.
IF time series function(x,y, -1) = 999 THEN you know you reached the "edges" of your model timeline.

I left the exact function to use vague because:
1. There is more than 1 that could be used, based on the situation.
2. I'd like you to look at the time series functions in the link above and try to figure it out.

However, if you still need help, please let me know and I'll walk you through it.

Einas
"Give a Man a Fish, and You Feed Him for a Day. Teach a Man To Fish, and You Feed Him for a Lifetime"
Moderator

## Re: Level 2 Sprint 3 SYS01 line items

Einas basically teaches you how to fish so that you feed yourself for the rest of your life. Right, Einas!

See if this post can help you Solved: Level 2 Sprint 3 INV01 - Not 1st week of Timescale... - Anaplan Community

Moderator

## Re: Level 2 Sprint 3 SYS01 line items

Did you go thru this part of the post. @einas.ibrahim Do you want to give a shot and explain it better

6 REPLIES 6
Master Anaplanner/Community Boss

## Re: Level 2 Sprint 3 SYS01 line items

Hello @LStinsa

You can programmatically determine the first period in your model (and the last period too). While there isn't a specific function to directly return this value, you can use a time series function
Some of the time series functions include a fill value parameter, which is basically a value the model builder specifies and expects it to be returned in case we reach the boundaries of the model timeline i.e. a period outside of the model's time range.
For example, you specify the fill value to -1 or 999 or any other value that you wouldn't get as a result of the function and compare.
IF time series function(x,y, -1) = 999 THEN you know you reached the "edges" of your model timeline.

I left the exact function to use vague because:
1. There is more than 1 that could be used, based on the situation.
2. I'd like you to look at the time series functions in the link above and try to figure it out.

However, if you still need help, please let me know and I'll walk you through it.

Einas
"Give a Man a Fish, and You Feed Him for a Day. Teach a Man To Fish, and You Feed Him for a Lifetime"
Moderator

## Re: Level 2 Sprint 3 SYS01 line items

Einas basically teaches you how to fish so that you feed yourself for the rest of your life. Right, Einas!

See if this post can help you Solved: Level 2 Sprint 3 INV01 - Not 1st week of Timescale... - Anaplan Community

Master Anaplanner/Community Boss

## Re: Level 2 Sprint 3 SYS01 line items

@Misbah

You are much better than me when it comes to finding past posts.

Thank you

Einas
"Give a Man a Fish, and You Feed Him for a Day. Teach a Man To Fish, and You Feed Him for a Lifetime"
Frequent Contributor

## Re: Level 2 Sprint 3 SYS01 line items

Sorry for not responding sooner.  I really appreciate you helping me but I still don't understand how you got to that answer.  I hate to beat this to death but I really do want to understand the concept. Thank you for pointing me to the timescale options.  Based on what I read, I see how I can use LEAD, NEXT, OFFSET as options.  But when I read through the example OFFSET(x,n,z) I still don't understand how you got to OFFSET (1,-1,0)=0.  I thought I understood how to use it based on the build we did in Sprint 2, but apparently not.

Moderator

## Re: Level 2 Sprint 3 SYS01 line items

Did you go thru this part of the post. @einas.ibrahim Do you want to give a shot and explain it better

Frequent Contributor

## Re: Level 2 Sprint 3 SYS01 line items

Thank you for the explanation!  That helped a lot.  It makes everything clearer.