I have a view that shows documents that have a multivalue date field in them. The problem is when I try to categorize by the month of the datefield in a column to get a monthly totalby using ‘@Month(datefield)’, the document shows up multiple times in the wrong month. For example if the multivalue date field has the dates 2005-1-31 and 2005-2-1 the document shows up twice in January and twice in February when it should only show up once in each. If I categorize by the entire date in the datefield it seems to be fine, but I would like monthly totals if possible. Is there an easy fix for this? Thanks in advance
Subject: Seems to be a problem running @Month on a datelist
I think the issue I am having is because @Month does not support a date list. The only alternative I can think of is to create new documents with a single date in each. I do not relish that thought as I will have to clean them up again if the date range ever changes. Not very good performance as some of the date ranges could span several months.
I am open to any other ideas.
Subject: @Transform(datefield; “d”; @Month(d)) should do.
As I always do, I’d recommend storing this value in a computed field you’ve added to the form for performance reasons.
Subject: Good Advice, but it behaves the same as before
Thanks anyway
Subject: monthly totals with multivalue date fields
If the view is set up to display a document more than once in any month (twice in February for 2005-2-15 and 2005-2-16), then you can’t get around the problem. The document will display in each month category as many times as there are date values in the document if you try to display the dates separately. If you try to display different values for each month that the document falls into, you’ll get one line for each month in every category. If you’re going for weeks, you’ll get one line for every week in ALL months under each category, and if you were hoping to separate out the days and happened to have an entry spanning six months, you’d get 183 entries under each month.
A document is either in a category or it isn’t – you can’t choose which of its values shows up in that category. View column formulas are per document, not per line.
The only way around this would be to do the application on the web – or use an agent to create a report.