Is there a way to group by a date, such as date created, where the groups are the actual dates and not the artificial groups that are used by default, like "Last Week", "Last Month", etc.?
It could be done via a script, but isn't built-in.
If you link your account we can help write the script if needed.
Hi,
Is the script for this available now.
My account is already linked.
I will also like to sometimes use Group by date by actual dates (e.g. Year, Quarter, Month, Week, Date) instead of current groups by Earlier This Week ... etc.
In case the script is not available already, I will highly appreciate if it can be created by someone for more common users. This looks like a pretty common requirement for date grouping for many uses.
Thanking in advance,
Regards,
I like to know this as well.
I also need to group by actual date i.e. Day, but also by Year, Quarter, Month, Week.
My account is already linked. Help with script for grouping by actual date will be highly appreciated. This is a fairly commonly needed feature.
You could group by custom column (Script Add-In) that shows the date as a string, like so:
function OnInit(initData) {
initData.name = 'ISODateString';
initData.default_enable = true;
initData.min_version = '12.0';
var col = initData.AddColumn();
col.method = 'OnISODateString';
col.name = 'ISODateString';
col.label = 'ISODateString';
col.header = 'ISODateString';
col.defwidth = 6;
col.autorefresh = 1;
col.autogroup = true;
}
function OnISODateString(scriptColData) {
scriptColData.value = scriptColData.item.modify.Format('D#yyyy-MM-dd');
}
ColumnISODateString.js.txt (520 Bytes)
Ixp, could you help me understand what date field is being used for this script, so that I can understand what to change? It appears to be the file modified date? I am using another script to add the EXIF DateTimeOriginal field and would like to put that date into string format so that I can group.
Yes, that's the modified date. Unfortunately, script columns cannot access other script columns. If you want DateTimeOriginal in ISO format, the other script needs to do this.
The good news: v13 can handle things like this easily. So you just have to wait a bit.
If you want to try out the v13 beta, here's the Evaluator Group that takes care of the formatting:
<?xml version="1.0"?>
<evalgroupscheme scheme_name="Date_ISO" sort="yes">
<eval>return DatePart(value, "yyyy-MM-dd");</eval>
<groups enable="no" />
</evalgroupscheme>