3 Replies Latest reply on Jun 11, 2017 11:26 PM by Ankit Gupta RSS
    akesana Explorer

    How to get last 10 days data into my info table from stream?

    Hi,

     

    We have a stream we are filtering data based one column name , Now we want check date also and get only last 10 days data.

     

    Please find below syntax

     

    // dateValue:DATETIME

    var dateValue = new Date();

    // dateAddDays(dateValue:DATETIME,amount:NUMBER):STRING

    var datetime = dateAddDays(dateValue, -10);

    var query =

    {

      "filters": {

          "type":"AND",

          "filters": [

              {

      "type": "LIKE",

      "fieldName": "source",

      "value": "*anil*"

       },

              {

                  "type":"GT",

              "fieldName":"timestamp",

              "value":datetime    // This is sting type but we want to validate date type how to do this check?

              }          

          ]

      }

     

     

    But it is not working as expected, could any one correct my mistake in the above code?

     

     

    Regards

    Anil Kesana