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

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

[infotable] Can I merge record by a column

AL_10742319
8-Gravel

[infotable] Can I merge record by a column

can I merge recode that same timestamp

AL_10742319_0-1721037770954.png

 

 

 

 


this is code to table

let params = {
infoTableName: undefined /* STRING {"defaultValue":"InfoTable"} */
};
 
// result: INFOTABLE
let table = Resources["InfoTableFunctions"].CreateInfoTable(params);
newField = {
    name: 'value1',
    baseType: 'NUMBER'
};
table.AddField(newField);
newField = {
    name: 'value2',
    baseType: 'NUMBER'
};
table.AddField(newField);
newField = {
    name: 'timestamp',
    baseType: 'DATETIME'
};
table.AddField(newField);
// result: INFOTABLE
table2 = Resources["InfoTableFunctions"].CreateInfoTable(params);
newField = {
    name: 'value1',
    baseType: 'NUMBER'
};
table2.AddField(newField);
newField = {
    name: 'value2',
    baseType: 'NUMBER'
};
table2.AddField(newField);
newField = {
    name: 'timestamp',
    baseType: 'DATETIME'
};
table2.AddField(newField);
 
 
table.AddRow({value1:10,timestamp:1700000010000});
table.AddRow({value1:12,timestamp:1700000020000});
table.AddRow({value1:14,timestamp:1700000040000});
table2.AddRow({value2:100,timestamp:1700000010000});
table2.AddRow({value2:120,timestamp:1700000020000});
table2.AddRow({value2:140,timestamp:1700000040000});
 
 
params = {
t1: table /* INFOTABLE */,
t2: table2 /* INFOTABLE */
};
//
// result: INFOTABLE
Union = Resources["InfoTableFunctions"].Union(params);
result=Union;
ACCEPTED SOLUTION

Accepted Solutions

You can do that using intersect. You can even use multiple columns and different sort of joins as in SQL.

View solution in original post

3 REPLIES 3

You can do that using intersect. You can even use multiple columns and different sort of joins as in SQL.

thank you for suggestion
now I create database thing and connect to thingworx db
then I create SQL Statement to query and join record in valuestream table

AL_10742319_1-1721354497783.png

 

 

Hello @AL_10742319,

 

It looks like you have a response on your topic. If it helped to answer your question please mark the reply as the Accepted Solution. 

Of course, if you have more to share on your issue, please let the Community know so other community members can continue to help you.

Thanks,
Vivek N.
Community Moderation Team.

Announcements


Top Tags