The POST function pushes a value a set number of periods into the future.
To calculate the value of a target cell for a particular time period (PTp), POST does the following for every time period (ETp):
- Executes the offset expression for the corresponding cell of the source for ETp.
- If the result of the offset is equal to the number of periods that ETp lags behind the PTp, then it executes the source expression at ETp and adds the result to the target at the PTp.
You could use POST to determine how much stock is arriving at a warehouse for separate time periods. From the example below, POST would be applied to the line item 'stock.'
Syntax
POST(line item or expression, Offset amount)
Example
POST(IF Order? THEN Order Volume ELSE 0, Shipping lead time)
Arguments
Argument | Data Type | Description |
Line item or Expression | Number | Value to be posted |
Offset amount | Numeric line item, property, or expression | Number of periods forward |
POST(IF Order? THEN Order Volume ELSE 0, Shipping lead time)
This formula calculates the Monthly stock received.
The table below illustrates a simple, constant, POST offset. Delivery by bike takes 3 months, by truck, 2 months.
If Order = True, then the value in Order Volume is posted in the Monthly stock
received row. This is offset by the number of periods cited in the Shipping lead time row.
Jan | Feb | Mar | April | May | June | July | Aug | |
Order? | -- | -- | -- | |||||
Order Volume | 100 | 50 | 0 | 300 | 0 | 175 | 50 | 0 |
Shipping Method | Bike | Truck | TBD | TBD | -- | Truck | Bike | -- |
Shipping lead time | 3 mo. | 2 mo. | -- | -- | -- | 2 mo. | 3 mo. | 0 |
Monthly stock received | 0 | 0 | 0 | 150 | 0 | 300 | 0 | 175 |
Guidelines
- POST can result in more than one source value being posted to a target period.
- POST is only applicable to numbers.
- Do not use POST for simple data offsets. OFFSET, LAG, or MOVINGSUM are more efficient.
- If the offset expression is negative, then POST returns the number of periods ahead.
- The time range providing arguments to a line item must match the time range for the result line item. Any formula that conflicts with this rule will be rejected. For more information, see Search page.
- A non-time series function, used as a sub-expression of this function, must use the same time range as the line item to which the formula is applied. Combining time series functions and non-time series functions with a time range could return an unexpected result or an error message. For more information, see Time Ranges and Time Series Functions page.
Similar functions
- OFFSET
- LAG
- LEAD
- PROFILE
- MOVINGSUM
Detailed examples
POST with a constant offset
For a constant offset LAG and POST behave in the same way. The offset is constant for each target period so there's only one source period that POSTs into it.
Jan | Feb | Mar | April | May | June | July | Aug | Sep | Oct | Nov | Dec | |
source | 1 | 2 | 4 | 10 | 20 | 40 | 100 | 200 | 400 | 0 | 0 | 0 |
LAG | 0 | 0 | 0 | 1 | 2 | 4 | 10 | 20 | 40 | 100 | 200 | 400 |
POST | 0 | 0 | 0 | 1 | 2 | 4 | 10 | 20 | 40 | 100 | 200 | 400 |
POST and lag with a variable offset
For a variable offset, LAG uses the value of the offset from the target time period. POST however uses the value of the offset from the source. As more than one source period can have an offset that points to the same target period, the values for all such source periods are added to give the target value. Below the offsets for Jan, Feb and March all point to March, so the value for March is the sum of the source values for Jan, Feb, and March.
Jan | Feb | Mar | April | May | June | July | Aug | Sep | Oct | Nov | Dec | |
source | 1 | 2 | 4 | 10 | 20 | 40 | 100 | 200 | 400 | 0 | 0 | 0 |
LAG | 0 | 0 | 0 | 1 | 2 | 4 | 10 | 20 | 40 | 100 | 200 | 400 |
offset | 2 | 1 | 0 | 2 | 1 | 0 | 2 | 1 | 0 | 0 | 0 | 0 |
POST | 0 | 0 | 7 | 0 | 0 | 70 | 0 | 0 | 700 | 0 | 0 | 0 |
POST with a conditional offset
For a conditional POST, we POST a value when a condition is met. The logical method to express this: (IF condition, then POST(...)) does not work as expected. This is because the formula expresses the value at the target period and it's the target value of the condition that is used. This controls the entire value of the target. To get the correct usage, evaluate the condition inside the POST call. Everything inside the POST call is evaluated at the source. In the case below, since the source condition is true then the source value is added to any others included in the POST to the target.
Jan | Feb | Mar | April | May | June | July | Aug | Sep | Oct | Nov | Dec | |
source | 1 | 2 | 4 | 10 | 20 | 40 | 100 | 200 | 400 | 0 | 2,000 | 4,000 |
offset | 2 | 1 | 0 | 2 | 1 | 0 | 2 | 1 | 0 | 2 | 1 | 0 |
condition | | -- | | -- | | -- | | -- | -- | -- | -- | |
IF condition THEN POST | 0 | 0 | 7 | 0 | 0 | 0 | 0 | 0 | 700 | 0 | 0 | 0 |
POST(IF condition THEN | 0 | 0 | 5 | 0 | 0 | 20 | 0 | 0 | 500 | 0 | 0 | 2,000 |