MicroStrategy ONE

Create Attribute statement

Creates an attribute within a project.

Copy
CREATE 
 ATTRIBUTEattr_name[DESCRIPTIONdesc] [LONGDESCRIPTIONlong_description] 
 IN [FOLDER]location_path[HIDDEN (TRUE 
 | FALSE)] ATTRIBUTEFORMform_nameFORMCATEGORYcategory_name[FORMDESCform_desc] [FORMTYPE 
 (NUMBER | TEXT | DATETIME | DATE | TIME | URL | EMAIL | HTML | PICTURE 
 | BIGDECIMAL)] [SORT (NONE | ASC | DESC)] EXPRESSIONform_expression[MAPPINGMODE 
 (AUTOMATIC | MANUAL)] [EXPSOURCETABLESsourcetable1, [,sourcetable2[, ...sourcetableN]]] LOOKUPTABLElookup_tableFOR PROJECTproject_name;

where:

  • attr_name is the name of the attribute, of type string, between double quotes (").

  • desc is the description of the attribute, of type string, between double quotes (").

  • long_description is the long description of the attribute, of type string, between double quotes (").

  • location_path is the folder where the attribute is to be placed, of type string, between double quotes (").

  • form_name is the name of the first form, of type string, between double quotes (").

  • form_desc is the description of the first form, of type string, between double quotes (").

  • category_name is the category name to be used in the form, of type string, between double quotes (").

  • form_expression is the expression of the first form, of type string, between double quotes (").

  • sourcetableN is the name of the source table to be used in the form, of type string, between double quotes (").

  • lookup_table is the name of the table to be used as the lookup, of type string, between double quotes (").

  • project_name is the name of the project, of type string, between double quotes (").

This statement can only be executed in a Windows environment.

Example

Copy
CREATE 
 ATTRIBUTE "Month" DESCRIPTION "Duplicate of Month Attribute 
 from folder \Time" IN FOLDER "\Schema Objects\Attributes" 
 ATTRIBUTEFORM "ID" FORMDESC "Basic ID form" FORMTYPE 
 TEXT SORT ASC EXPRESSION "[MONTH_ID]" LOOKUPTABLE "LU_MONTH" 
 FOR PROJECT "MicroStrategy Tutorial";