Week To Date

Returns a set of members from the same level as the given member (siblings), beginning with the first sibling member and ending with the given member, constrained by the Week level in the Time dimension.

Syntax & Usage

WTD(<model member>[, <integer value OR day flag>])

<model member>

A PQL expression that returns a single member element. The member must exist in the data source - it cannot be a custom member. For the WTD function, this should be a member from the dateKey hierarchy; the given member will be the last date in the list.

<integer value OR day flag>

The integer value is the numeric value that determines which day of the given week the list should start from. Numbers from 1-7 indicate Monday-Sunday. Set this value from the Insert Arguments window under 'Day of week to start from'.

The day flag also determines which day of the given week the list should start from. Add one of the following flags to the expression in script mode: MON/ TUE/ WED/ THU/ FRI/ SAT/ SUN. The day flag can only be added from the custom list IDE.

Example

The given model member is 2008-04-04; this will be the last element in the list:

The start day is set to one, so the resulting set will comprise a list of dates from the first day of the given week, up to and including the selected date:

{WTD([data].[dateKey].[1207267200000],1)}