1. Calculation functions
  2. All Functions
  3. Time and Date Functions
  4. WEEKTODATE

WEEKTODATE aggregates the daily values within a week from a single numeric parameter. WEEKTODATE resets after the last day of the week.

You could use WEEKTODATE to compare orders received this week with the orders from previous weeks, up to and including the same day of the week. WEEKTODATE resets at each weekly interval.

Syntax

WEEKTODATE(Line item to aggregate)

Arguments

ArgumentData TypeDescription
Line item to
aggregate 
Number or numeric line item.The line item to aggregate in a weekly timeframe.

The WEEKTODATE function returns a number-formatted result.

Syntax example

WEEKTODATE(Sales)

WEEKTODATE below is used to show cumulative sales.


02-Feb-2103-Feb-2104-Feb-2105-Feb-2106-Feb-2107-Feb-2108-Feb-21
Unit costs130155125142137151122
Packaging 30 40 26 38 41 33 39
Sales110 53 37 72 6793102
WEEKTODATE
(Sales)
110163200272339432534

Constraints

  • The source Time Scale must be Day.
  • WEEKTODATE cannot be used if Calendar Type is Months/Quarters/Years.

Calculation engine functionality differences

In Polaris, you can use the WEEKTODATE function with line items that have a matching time scale. For example, you can use WEEKTODATE with a line item with a time scale of Week.

In the Classic Engine, you cannot.

Related Anaplan functions

In the following example, WEEKTODATE is used to aggregate revenue for each day of the week.


28 Mar 2129 Mar 2130 Mar 2131 Mar 211 Apr 212 Apr 213 Apr 21
Revenue32,50030,80029,050 27,500 31,250 33,400 32,750
WEEKTODATE(Revenue)32,50063,30092,350119,850151,100184,500217,250