Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X
I have inserted two input date: startDate and endDate.
I have inserted this JS code in my service:
var params = {
infoTableName : "InfoTable",
dataShapeName : "TFPeopledata",
startDate: startDate,
endDate: endDate,
maxItems: maxValues
};
var result = Resources["InfoTableFunctions"].CreateInfoTableFromDataShape(params);
for each(var row in res.rows){
var newEntry = new Object();
newEntry.People_in_region = row.People_in_region;
newEntry.date_trunc = dateAddHours(row.date_trunc, -2); // DATETIME
result.AddRow(newEntry);
}
The prob is don''t refresh with date selected.
I don't see the query, but anyway, your code duplicates entries ( as you are iterating over result collection variable and in the loop you are adding to the same result collection variable ). This is Javascript code not Java code I'm right?
I have used a ValueStream for data storage
var res = Resources["CSVParserFunctions"].ReadCSVFile(params);
var maxValues = 100;
var oldFirst = false;
if(startDate != undefined){
maxValues = 5000;
// oldFirst = true;
}
var params = {
oldestFirst: false /* BOOLEAN */,
endDate: endDate /* DATETIME */,
maxItems: maxValues /* NUMBER */,
startDate: startDate /* DATETIME */
};
var history = me.QueryPropertyHistory(params);
var result = history;
var params = {
infoTableName : "InfoTable",
dataShapeName : "TFPeopledata",
startDate: startDate,
endDate: endDate,
maxItems: maxValues
};
var result = Resources["InfoTableFunctions"].CreateInfoTableFromDataShape(params);
for each(var row in res.rows){
var newEntry = new Object();
newEntry.People_in_region = row.People_in_region;
newEntry.date_trunc = dateAddHours(row.date_trunc, -2); // DATETIME
result.AddRow(newEntry);
}
timestamp
I think the prob with the data stream.
I don't know man, your code doesn't have much sense I'm sorry.