EducationSoftwareStrategy.com
StrategyCommunity

Knowledge Base

Product

Community

Knowledge Base

TopicsBrowse ArticlesDeveloper Zone

Product

Download SoftwareProduct DocumentationSecurity Hub

Education

Tutorial VideosSolution GalleryEducation courses

Community

GuidelinesGrandmastersEvents
x_social-icon_white.svglinkedin_social-icon_white.svg
Strategy logoCommunity

© Strategy Inc. All Rights Reserved.

LegalTerms of UsePrivacy Policy
  1. Home
  2. Topics

KB15810: How to modify the column alias for an attribute using the MicroStrategy Intelligence Server SDK 9.4.x


Community Admin

• Strategy


How to modify the column alias for an attribute using the MicroStrategy Intelligence Server SDK 9.4.x

The object structure followed by Strategy when storing information related to attribute forms and columns for an attribute is as follows (to show the structure of an attribute, the example will use the attribute 'Subcategory' as an example):
 
<pre>Attribute (Subcategory)
Base Forms (ID, DESC…)
Column (Column used to define column alias)
Table (Table used to build SQL)
Expression (Expression used to build SQL)</pre>
Scenario 1
The attribute, when first created, shares the same column in the column parameter and in the expression. If users change the column definition to modify the column alias name, the way the SQL is generated might be modified too. To avoid this, create a new column object and associate with the column parameter in the attribute - base forms section.
 
Scenario 2
The attribute already has a column object, different from the one in the expression, associated to the column parameter. In this case users can modify the properties of the column object directly without affecting the SQL generation.
 
The above is translated into code as follows:
 
… After successfully connecting to the Intelligence Server - Project and creating a valid session…
 
 
'Declare needed variables
Dim attrib As IDSSAttribute
Dim column_alias As IDSSColumn
Dim attribForms As IDSSAttributeForm
Dim columnID As String
'Find attribute (in my example Subcategory att)
Set attrib = objSource.FindObject("27C4F357490C58F1480D3EBE5A7D0A12", DssTypeAttribute)
'Find the ID of column used as column alias
columnID = attrib.Forms.BaseAttributeForms.Item(0).Column.Info.ID
'Use the column ID to find the properties of the object
Set column_alias = objSource.FindObject(columnID, DssTypeColumn)
'Change the name of the column object and the name used
'to display the column in desktop
column_alias.Info.Name = "ZZZ_SDK_VB" 'Object name
column_alias.ColumnName = "ZZZ_SDK_VB" 'Desktop SQL display
'Save the modified object
objSource.SaveObject column_alias.Info, , DssSourceSaveOverwrite
Set MySession = Nothing
Set MySource = Nothing
Set objSource = Nothing
Set MyDataSource = Nothing
MsgBox "Done"
 
Customization Code Warning:
This customization is provided as a convenience to Strategy users and is only directly applicable to the version stated. While this code may apply to other releases directly, Strategy Technical Support makes no guarantees that the code provided will apply to any future or previous builds. In the event of a code change in future builds, Strategy may not be able to provide additional code on this matter even though this customization is provided at this time for this specific build
 


Comment

0 comments

Details

Knowledge Article

Published:

June 12, 2017

Last Updated:

June 12, 2017