API
@-Formulas
JavaScript
LotusScript
Reg Exp
Web Design
Notes Client
XPages
 
Categorize A View On Month Name
We've seen many developers want to do this, but not be able to figure it out. In a view, you want to group documents based on a month (like the month they were created) but the month names should appear in month order ("January" though "December") and not in alphabetical order ("April", "August", ..., "October", "September").

We have a sample picture that shows how it should look.

To duplicate what you see in the view, there are three columns before the "real" data (before the subject column). The first column is a categorized column (sorted in decending order) on the year. The column formula is:

@Year(@Created)

The column will show the year, with more recent documents at the top. The next column is a hidden column, NOT categorized, that is sorted in ascending order. (It could be sorted in decending order to show more recent documents at the top). The column formula is:

@Month(@Created)

This column prepares everything for the visible third column. The third column is a categorized column (it doesn't matter if it's ascending or descending) that shows the month name. The column formula is:

@Select(@Month(@Created); "January"; "February"; "March"; "April"; "May"; "June"; "July"; "August"; "September"; "October"; "November"; "December")

Based on the month number, the correct name will appear. And the hidden second column will be used to sort first, to make sure the months appear in the desired numeric order instead of in alphabetical order.