Hi There, What I want to do is very simple but I am having trouble achieving this. Insummary I need to set a filtet on a data item several times in order to calculate a total value each time. To do this which is date based I do the following: STARTDATE:=CALCDATE(-??M,WORKDATE) ENDATE: = WORKDATE; The problem is that I need ?? to represent an array value as the period of time ranges from 1 to 5 months. May be this isn’t possible and there is a better way, whichever I would appreciate some assistance. Cheers :wink: :wink: :wink: [:)]

How about: FOR i := 1 TO 5 DO BEGIN StartDate := CALCDATE(STRSUBSTNO('<-%1M>',i),WORKDATE); {...} END;

You could indent your data item, and insert a new data item above it. The new data item would be for table Integer with DataItemTableView SORTING(Number) WHERE(Number=FILTER(1…5)) Then use the code as provided above, i.e. StartDate := CALCDATE(STRSUBSTNO(’<-%1M>’,Integer),WORKDATE); or: StartDate := CALCDATE(STRSUBSTNO(’-%1M’,Integer),WORKDATE);