MicroStrategy ONE

Create Attribute statement

Creates an attribute within a project.

Copy
CREATE ATTRIBUTE "<attribute_name>" [DESCRIPTION "<description>"] [LONGDESCRIPTION "<long_description>"] IN [FOLDER] "<location_path>" [HIDDEN (TRUE | FALSE)] ATTRIBUTEFORM "<form_name>" [FORMCATEGORY "ID"] [FORMDESC "<form_description>"] [FORMTYPE (NUMBER | TEXT | DATETIME | DATE | TIME | URL | EMAIL | HTML | PICTURE | BIGDECIMAL | PHONENUMBER)] [REPORTSORT (NONE | ASC | DESC)] [BROWSESORT (NONE | ASC | DESC)] EXPRESSION "<form_expression>" [MAPPINGMODE (AUTOMATIC | MANUAL)] [EXPSOURCETABLES "<sourcetable1>" [, "<sourcetable2>" ...]] LOOKUPTABLE "<lookup_table>" FOR PROJECT "<project_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" FORMCATEGORY "ID" FORMDESC "Basic ID form" FORMTYPE TEXT SORT ASC EXPRESSION "[MONTH_ID]" LOOKUPTABLE "LU_MONTH" FOR PROJECT "MicroStrategy Tutorial";