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

Community Tip - Need help navigating or using the PTC Community? Contact the community team. X

How to get distinct values of properties?

ahawaldar
1-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
supandey
19-Tanzanite
(To:ahawaldar)

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);

Hello Sushant,

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

Thanks,

Azim

supandey
19-Tanzanite
(To:ahawaldar)

Are you looking for Infotable?

Hi Sushant Pandey​,

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

Thanks,

Azim

supandey
19-Tanzanite
(To:ahawaldar)

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

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

Thanks,

Azim

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);

supandey
19-Tanzanite
(To:ahawaldar)

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

Hi Sushant Pandey​,

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

Thanks,

Azim

Top Tags