JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://alasql.org/console/alasql.min.js"></script>
<div id="res"></div>
<script type="application/json" id="timing_output">
[
{
"path" : "https:\/\/mail.google.com\/mail\/u\/0",
"projects" : [
"X. Ambiguous: Communication Inbox"
],
"endDate" : "2015-02-11, 1:00 PM",
"startDate" : "2015-02-11, 12:00 PM",
"application" : "Safari",
"duration" : 1528.618035137653
},
{
"path" : "",
"projects" : [
"Y. Timesuck: Laptop Maintenance [TT-28]"
],
"endDate" : "2015-02-11, 1:00 PM",
"startDate" : "2015-02-11, 12:00 PM",
"application" : "Flash Player (Safari Internet plug-in)",
"duration" : 68.77424800395966
},
{
"path" : "\/Volumes\/Storage\/martincleaver\/SoftwareDevelopment\/alasql\/MRJC\/alasql1.sql",
"projects" : [
],
"endDate" : "2015-02-11, 2:00 PM",
"startDate" : "2015-02-11, 1:00 PM",
"application" : "TextMate",
"duration" : 70.63207685947418
}
]
</script>
JavaScript
alasql('SELECT projects, FIRST(duration) AS duration, FIRST([path]) AS [path], FIRST(application) AS application \
FROM json("#timing_output") \
GROUP BY projects, duration, [path], application \
ORDER BY duration DESC ;\
',[],function(res){ document.getElementById('res').textContent = JSON.stringify(res);
});