Skip to main content
5-Regular Member
October 30, 2015
Solved

Is there "Distinct" function in the Infotable services?

  • October 30, 2015
  • 1 reply
  • 4016 views

I would like to get distinct items from results that are infotable type.

It's similar with "distinct()" of SQL.

Is there anyone know about this as a embedded function of Thingworx?


    Best answer by YangJaeUng

    I'm sorry.

    I found distinct service in the Infotable function.

    Below is my code.

    Please refer my code if you have same problem of mine.

    ============================================================

    var params = {

      maxItems: 500 /* INFOTABLE */,

      startDate: undefined /* QUERY */,

        endDate : undefined,

        oldestFirst: false,

    };

    var result = me.QueryPropertyHistory(params);

    var params = {

      t: result,

        columns: "UserID"

    };

    // result: INFOTABLE dataShape: "undefined"

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

    ======================================================================

    1 reply

    YangJaeUng5-Regular MemberAuthorAnswer
    5-Regular Member
    October 30, 2015

    I'm sorry.

    I found distinct service in the Infotable function.

    Below is my code.

    Please refer my code if you have same problem of mine.

    ============================================================

    var params = {

      maxItems: 500 /* INFOTABLE */,

      startDate: undefined /* QUERY */,

        endDate : undefined,

        oldestFirst: false,

    };

    var result = me.QueryPropertyHistory(params);

    var params = {

      t: result,

        columns: "UserID"

    };

    // result: INFOTABLE dataShape: "undefined"

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

    ======================================================================