Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X
Hello Everyone ;
In our project there are two DataTable. Both have services which output as InfoTable. We can call them testData and raspiData. Normally this two table must be have equal data. But when it doesnt i want to know which row is missing.
testData raspiData
result data
My service wont work properly. I dont know where i wrong. It should be list only Barcode "1005" because it isnt in the other table.
var testData = Things["testDT"].Select();
var raspiData = Things["RaspiData"].Select();
//-----------------------------------------------------------
var params = {
infoTableName : "InfoTable",
dataShapeName : "testDS"
};
var result = Resources["InfoTableFunctions"].CreateInfoTableFromDataShape(params);
//--------------------------------------------------
var tableLength = testData.rows.length;
for (var x = 0; x < tableLength; x++) {
var row = testData.rows
; var tableLength2 = raspiData.rows.length;
for (var y = 0; y < tableLength2; y++) {
var row2 = raspiData.rows
; if(row.Barcode != row2.Barcode){
var newEntry = new Object();
newEntry.Barcode = row.Barcode;
newEntry.ProdID = row.ProdID;
newEntry.StationID = row.StationID;
result.AddRow(newEntry);
}
}
}
Any help will be appreciated.
Thank you.
Solved! Go to Solution.
You could try comparing the number of entries in each and then for the one that has more entries, query each for the other table until you hit a missing one, then add?
You could try comparing the number of entries in each and then for the one that has more entries, query each for the other table until you hit a missing one, then add?