## Formula Help: Apply Rev. to Earliest Date

Occasional Contributor

## Formula Help: Apply Rev. to Earliest Date

Hi,

I need to create some logic where revenue that is allocated to a parent, is all placed onto the child with the earliest date associated with it.

1 ACCEPTED SOLUTION

Accepted Solutions
Contributor

## Re: Formula Help: Apply Rev. to Earliest Date

Without knowing much detail, I assume their is a date column for all the children called something like "Start Date".  Make a new LI which uses Rank to find the newest and break ties using sequential with something like: RANK("Start Date", ASCENDING, Sequential, TRUE, a Text LI which is the same for each group of Children).  Then in another LI have an IF Statement so if the Rank = 1 you assign that product all the revenue.  Note that Rank is something you should try to avoid if you can find another solution.  You could try a Min on Start Date and then check to see if the parent start date equaled the child start date. in a another LI too if you aren't worried about 2 children having the same start date which would be more efficient.

4 REPLIES 4
Contributor

## Re: Formula Help: Apply Rev. to Earliest Date

Hi!

Can you provide more context to what you mean by earliest date associated? Also, are you assigning 100% of the revenue to one child of a parent or to multiple?

Thanks,
Contributor

## Re: Formula Help: Apply Rev. to Earliest Date

Without knowing much detail, I assume their is a date column for all the children called something like "Start Date".  Make a new LI which uses Rank to find the newest and break ties using sequential with something like: RANK("Start Date", ASCENDING, Sequential, TRUE, a Text LI which is the same for each group of Children).  Then in another LI have an IF Statement so if the Rank = 1 you assign that product all the revenue.  Note that Rank is something you should try to avoid if you can find another solution.  You could try a Min on Start Date and then check to see if the parent start date equaled the child start date. in a another LI too if you aren't worried about 2 children having the same start date which would be more efficient.

Occasional Contributor

## Re: Formula Help: Apply Rev. to Earliest Date

This worked perfectly. Don't know why i didn't think to use the rank function!
Community Boss

## Re: Formula Help: Apply Rev. to Earliest Date

Create module dimensioned by the child.

Create line items including parent (parent list format ), date ( date format ) and phasing ( number format )

Use the following formula for the parent line item =PARENT(ITEM(CHILD LIST))

Allocate the associated date to each child item. Set the summary method to Min.

Use the following formula in the phasing module = IF date[LOOKUP:Parent] = date then 1 else 0

This will allocate a 1 against the child item whose date matches the min summary at the parent level.

You can then use this to phase the parent value down the child in a target module dimensioned by the child list.

Be mindful that if you have more than one child item with the same date you will duplicate the phasing across multiple child list items.

Chris Heathcote
Bedford Consulting

Gold Partner and Regional Partner of the Year 2021, EMEA