IBM Support

How to use Alias values as Captions with a Planning Analytics connection

Troubleshooting


Problem

When using a TM1 connection within Cognos Analytics, one could assign an alias to a dimension when publishing a package to make those alias values appear as the captions of members in the dimension. The above does not work when using a Planning Analytics data saource connection. This document provides a solution.

Resolving The Problem

The Planning Analytics data source type in Cognos Analytics looks for an element alias named Caption. If the dimension in the Planning Analytics model does not have an alias named Caption then Cognos Analytics will display the element name.

A Turbo Integrator (TI) process can be used to create the Caption alias (an alias type attribute named Caption) and set the value of the Caption alias to the desired value. It also possible to simply edit the attributes of the dimension In Architect, Perspectives, or Performance Modeler to include an alias named Caption and set the value

Here's an example TI process code (prolog section) that can be used to create an alias named Caption and set the value. This code checks for and creates an alias named Caption, then copies the value from an existing alias in the dimension.

Step 1 - determine the name of the dimension and alias that you want to appear in the metadata tree in Cognos Analytics

Step 2 - Create a new "Script only" process, and paste the following contents to the prologue.

####################################


####Modify these parameters####

#Specify Dimension
vDimension='MyDimension';
#Specify the Alias you want to appear
vAlias='MyAlias';

####################################

####################################
###Do not modify these parameters###

# Check for an attribute named caption
IF( DIMIX( vDimension, 'Caption' ) = 0 );
# Check for an attribute named caption with the type alias
AttrInsert ( vDimension, '', 'Caption', 'A' );
ELSE;
# Quit the Ti process if the dimension already has any attribute named Caption
ProcessQuit;
ENDIF;

vElement='';
vCaption='';
i=1;

While (i<=DimSiz(vDimension));
vElement=DIMNM(vDimension,i);
vCaption =CellGetS('}ElementAttributes_'|vDimension,vElement,vAlias);
CellPutS(vCaption,'}ElementAttributes_'|vDimension,vElement,'Caption');
i=i+1;

End;
####################################

Step 3 - Replace the vDimension and vAlias parameters in the first section with your own from Step 1.

Step 4 - Execute the process

Note that this process would need to be executed when new members are added to the dimension.

[{"Product":{"code":"SSTSF6","label":"IBM Cognos Analytics"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"--","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"11.0.6","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
01 August 2019

UID

swg22005244