Skip to main content
1-Visitor
November 25, 2014
Question

datatable aggregate by day

  • November 25, 2014
  • 3 replies
  • 2955 views

I have a dataTable that has columns that I would like to aggregate by the date part of the timestamp field but I'm not sure how to accomplish this. 

    3 replies

    1-Visitor
    December 2, 2014

    There are some JavaScript functions you can use to get the Date only from a Date/Time and then you can use the build in Aggregate service.

    12-Amethyst
    October 4, 2015

    you can use this:

    var params = {

        types: 'STRING' /* STRING */,

        t: events /* INFOTABLE */,

        columns: 'date' /* STRING */,

        expressions: 'timestamp.getUTCFullYear()+"/"+(timestamp.getMonth() + 1)+"/"+timestamp.getUTCDate() '/* STRING */

    };

    // result: INFOTABLE

    var r = Resources["InfoTableFunctions"].DeriveFields(params);