cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

How to get distinct values of properties?

Newbie

How to get distinct values of properties?

Hi,

I have a thing whose property values are repeated. How to get distinct values from this property values? some thing like sql query SELECT distinct(propertyname) from table.

Thanks,

Azim

9 REPLIES 9

Re: How to get distinct values of properties?

Hi Azim are you trying to get distinct value from Infotable? There's an existing DISTINCT script available something like this

var params = {

t: undefined /* INFOTABLE */,

columns: undefined /* STRING */

};

// result: INFOTABLE

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

Re: How to get distinct values of properties?

Hello Sushant,

Is there any service which can return me this distinct values?

Thanks,

Azim

Re: How to get distinct values of properties?

Are you looking for Infotable?

Re: How to get distinct values of properties?

Hi Sushant Pandey​,

Since there could be one or more distinct values then it would be an info table.

Thanks,

Azim

Re: How to get distinct values of properties?

It should be Distinct as you can see under the ThingWorx Composer > System > Resources > InfoTableFunctions > Distinct

Re: How to get distinct values of properties?

Can a service return distinct values? If no can you please tell me java equivalent of below code.

var params = { 

t: undefined /* INFOTABLE */

columns: undefined /* STRING */ 

}; 

 

 

// result: INFOTABLE 

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

Re: How to get distinct values of properties?

Could you please tell me how can I achieve the same using java?

Thanks,

Azim

Re: How to get distinct values of properties?

Did you test out this service? Is it not returning what you are looking for?

Highlighted

Re: How to get distinct values of properties?

Hi Sushant Pandey​,

I could not test this. I do not know how can I execute this service in Java.

Thanks,

Azim