## How to input for the first Item while using the Previous Function

Regular Contributor

## How to input for the first Item while using the Previous Function

Hi,

I would like to know how I can input the first number that I need my Previous Function to read from. I know I need to add to the formula but not sure what to do. Please advice. Images attached.

Thank you

4 REPLIES 4
Community Boss

## Re: How to input for the first Item while using the Previous Function

Are you looking for the ability to specify which previous value you would like to pull into a cell?

If so, use the OFFSET function and specify the number of time periods in the past you wish to pull across.

Chris Heathcote
Bedford Consulting

Gold Partner and Regional Partner of the Year 2021, EMEA
Moderator

## Re: How to input for the first Item while using the Previous Function

What is that value supposed to be, a zero since I believe it is the first period of your Time Calendar?  If so, use Lag() as the last parameter can be used as the default.

Rob

Certified Master Anaplanner

## Re: How to input for the first Item while using the Previous Function

Hi @neg177

If the previous hints won't help please try this.

In my understanding, you want some initial numbers in the very first period of your timescale.

For that, I would use a separate module with no time scale but the rest dimensions are the same. Then edit your formula to have an IF THEN function where you would refer to this new module if a period is the first one.

The formula should be like this:

IF START() = <a new line item with initial period> THEN <new module> ELSE PREVIOUS(Ending RTR Balance)

Kirill

Certified Master Anaplanner

## Re: How to input for the first Item while using the Previous Function

You actually even can combine with the previous answers.

Both OFFSET and LAG function have this last argument "Substitute value".

`OFFSET(Value to offset, Number of periods, Substitute value) `
`LAG(Value to offset, Offset amount, Substitute value [, Non-positive behavior]) `