Follow

Integration Configuration - Comment Query with Calendar Context

Any comments added to data points will be available to be consumed, including comments added to historical data points that might have already been consumed.  All measure value data will also be available with the comments data.

In addition to the measure value placeholders, the following placeholders can be used with regard to comments:

  • [measurecomment]
This will be replaced by the comment entered against the measure time period.
  • [measurecommentdatetime]
This will be replaced by the timestamp for the comment had been entered.
  • [measurecommentdatetimeutc]
This will be replaced by the UTC timestamp for the comment had been entered.
  • [measurecommentmeasurevalueid]
This will be replaced by the measure value ID for the comment which it had been captured against.
  • [measurecommentmeasuretimeperiodid]
This will be replaced by the measure time period ID that the comment had been captured against.
  • [measurecommentusername]
This will be replaced by the username entered for the comment. If no value is found, it will be replaced by a blank string (“”).
  • [measurecommentusernameid]
This will be replaced by the unique username ID that was entered for the comment. If no value is found, it will be replaced by a NULL value.
   

Microsoft SQL Example

update Comments set Comment = '[MeasureComment]' where DateTime='[MeasureCommentDateTime]'
IF @@ROWCOUNT=0
insert into Comments (Comment, DateTime, TimePeriodId, UserName, MeasureId) values
('[MeasureComment]', '[MeasureCommentDateTime]',[MeasureCommentMeasureTimePeriodID],
'[MeasureCommentUsername]', [MeasureID])

MySQL Example

update Comments set Comment = '[MeasureComment]' where DateTime= '[MeasureCommentDateTime]'
IF @@ROWCOUNT=0
insert into Comments (Comment, DateTime, TimePeriodId, UserName, MeasureId) values
('[MeasureComment]', '[MeasureCommentDateTime]',[MeasureCommentMeasureTimePeriodID],
'[MeasureCommentUsername]', [MeasureID])

PostgreSQL Example

do $$
begin
update schema.""Comments"" set ""Comment""= '[MeasureComment]'
where ""DateTime""='[MeasureCommentDateTime]'
IF NOT FOUND THEN
insert into schema."" Comments "" (""Comment "", ""DateTime"", "" TimePeriodId"",
"" UserName"","" MeasureId "") values ('[MeasureComment]', '[MeasureCommentDateTime]',[MeasureCommentMeasureTimePeriodID],
'[MeasureCommentUsername]', [MeasureID])
end if;
end
$$
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments