How manually add cell comments from TM1, using }CellAnnotations cube

Instruction how manually add comments to cells in Cognos Application from TM1, using }CellAnnotations cube

When you add comments to cell in Cognos Application, cognos writes information to "}CellAnnotation_Cube name" cube. Data is written in following format (but is written in one line, without spaces and new lines).

[
  {
    "caption": "",
    "creator": "Username",
    "id": "pdFhJHRmoH",
    "properties": {
      "commentLocation": "2018,Month,[...],Comments",
      "commentType": "ANNOTATION",
      "commentValue": "Message",
      "objectName": "Cube name"
    },
    "timeCreated": "20180222104328"
  }
]

Not all of this properties are mandatory. Cognos requires these:

  • caption (can be empty)
  • creator (write any)
  • id (also can be empty)
  • properties
    • commentValue (this is the value of comment)
  • timeCreated (time in format YYYYMMDDHHMMSS)

Any other properties can be skipped.

So, when you know this, you can create you own annotations to cube cells, and for example write them automatically from TI Process. Use CellPutS function for this:

vHiddenComment = 'Some comment';
sHiddenCommentJSON = '[{"caption":"","creator":"Admin","id":"","properties":{"commentValue":"'|vHiddenComment|'"},"timeCreated":"20180222104328"}]';
CellPutS(sHiddenCommentJSON, sCubeNameCommentaries, 
			sApplicationID, 
			dim1Elements, dim2Elements, dimNElements, 
			'Annotations');

sApplicationID is generated by Cognos ID of application, you can find it in url, when you get access to the Application on the portal:

Screen_Shot_2018-02-22_at_16_17_12-1