PW
PW('Node')
The PW function shifts the input node one week into the future while retaining all other dimensions.
Use this function when you need last week’s values alongside current data for week-over-week comparisons.
Parameters
- NodeNode referenceRequired
- Input node that is shifted, specified using the node name in single quotes (e.g.
'Profit')
Watch out
- This function is only available on projects that use the week time dimension. A project has either Year, Quarter, Month and Day or Iso-Year, Week and Day, never both, so on a month-dimension project the node fails with an error saying the Week level could not be found. The time dimension is chosen per project, see Project Settings.
Examples
Shifting values by one week
Each value appears one week later in the result.
Input node: 'Profit'
| Week | Value |
|---|---|
| 2025-W01 | 35 |
| 2025-W02 | 42 |
| 2025-W03 | 47 |
Formula: PW('Profit')
| Week | PW Result |
|---|---|
| 2025-W02 | 35 |
| 2025-W03 | 42 |
| 2025-W04 | 47 |
Shifting values by two weeks (nested PW)
Nesting PW calls shifts values further into the future. Here, each value moves two weeks forward. Try SHIFT as an alternative with a custom offset.
Input node: 'Profit'
| Week | Value |
|---|---|
| 2025-W01 | 38 |
| 2025-W02 | 45 |
| 2025-W03 | 52 |
Formula: PW(PW('Profit'))
| Week | PW Result |
|---|---|
| 2025-W03 | 38 |
| 2025-W04 | 45 |
| 2025-W05 | 52 |