1 Reply Latest reply on Apr 28, 2017 6:04 AM by Ankit Gupta RSS
    vvu Newbie

    Counting a result value from service ?

    Let me clarify this problem:
    I have a properties "doorSensor" and the value is true/false - which represent for open and close the door.

    I used general service "QueryBooleanPropertyHistory" to get all the result in a week, which return a list of time and the value true/false.

    How can I  use aggregate function with this result , I need a total of times that door is open and close. Is it relate something with text field query in the service ?

      • Re: Counting a result value from service ?
        Ankit Gupta Ninja

        Hi vietanh vu,


        I think you are on the Right track.

        You can use aggregates as COUNT and group by column using groupByColumns to get the total count for open and close.


        var params = {

            t: undefined /* INFOTABLE */,

            columns: undefined /* STRING */,

            aggregates: undefined /* STRING */,

            groupByColumns: undefined /* STRING */



        // result: INFOTABLE

        var result = Resources["InfoTableFunctions"].Aggregate(params);


        Do let me know if you face any issue.