0
votes

I have set of data that is automatically updated each day with new lines. On the other hand my graphs shows weekly/monthly data.

Is there any way to exclude current week/month, so that the graph can be automatically updated on the server, without me manually excluding and including weeks/months each time I have data for full week/month?

3

3 Answers

2
votes

Here's another option which I use regularly in my reports.

  1. Index your date field by week, with a calculated field: STR(DATEDIFF('week', [Date], today(), 'monday'))

Note that here I have specified my weeks start on Monday, your requirement may be different.

  1. Drag this field onto filters and exclude the value 0, as in the index the current week will always be 0, last week will be 1 etc.

enter image description here

1
votes

This is an untested example of a calculated field to exclude current week:

IF DATETRUNC('week',[your date field]) = DATETRUNC('week',NOW()) THEN
    'filter me'
ELSE
    'leave me'
END

Drag that calculated field to filters. In case you couldn't guess, exclude the 'filter me' value :)

0
votes

make a copy of your date field. Drop on filter, select condition tab, select by formula and drop this in the field:

datetrunc('week',[Order Date (copy)]) <> datetrunc('week',today())