DimensionService
DimensionService(rest)
Bases: ObjectService
Service to handle Object Updates for TM1 Dimensions
Source code in TM1py/Services/DimensionService.py
hierarchies = HierarchyService(rest)
instance-attribute
subsets = SubsetService(rest)
instance-attribute
create(dimension, **kwargs)
Create a dimension
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dimension
|
Dimension
|
instance of TM1py.Dimension |
required |
Returns:
| Type | Description |
|---|---|
Response
|
response |
Source code in TM1py/Services/DimensionService.py
create_element_attributes_through_ti(dimension, **kwargs)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dimension
|
Dimension
|
Instance of TM1py.Objects.Dimension class |
required |
Returns:
| Type | Description |
|---|---|
|
|
Source code in TM1py/Services/DimensionService.py
delete(dimension_name, **kwargs)
Delete a dimension
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dimension_name
|
str
|
Name of the dimension |
required |
Returns:
| Type | Description |
|---|---|
Response
|
|
Source code in TM1py/Services/DimensionService.py
execute_mdx(dimension_name, mdx, **kwargs)
Execute MDX against Dimension. Requires }ElementAttributes_ Cube of the dimension to exist !
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dimension_name
|
str
|
Name of the Dimension |
required |
mdx
|
str
|
valid Dimension-MDX Statement |
required |
Returns:
| Type | Description |
|---|---|
List
|
List of Element names |
Source code in TM1py/Services/DimensionService.py
exists(dimension_name, **kwargs)
Check if dimension exists
Returns:
| Type | Description |
|---|---|
bool
|
|
get(dimension_name, **kwargs)
Get a Dimension
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dimension_name
|
str
|
|
required |
Returns:
| Type | Description |
|---|---|
Dimension
|
|
Source code in TM1py/Services/DimensionService.py
get_all_names(skip_control_dims=False, **kwargs)
Ask TM1 Server for list of all dimension names
:skip_control_dims: bool, True to skip control dims :Returns: List of Strings
Source code in TM1py/Services/DimensionService.py
get_number_of_dimensions(skip_control_dims=False, **kwargs)
Ask TM1 Server for number of dimensions
:skip_control_dims: bool, True to exclude control dims from count
Returns:
| Type | Description |
|---|---|
int
|
Number of dimensions |
Source code in TM1py/Services/DimensionService.py
update(dimension, keep_existing_attributes=False, **kwargs)
Update an existing dimension
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dimension
|
Dimension
|
instance of TM1py.Dimension |
required |
keep_existing_attributes
|
True to make sure existing attributes are not removed |
False
|
Returns:
| Type | Description |
|---|---|
|
None |
Source code in TM1py/Services/DimensionService.py
update_or_create(dimension, **kwargs)
update if exists else create
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dimension
|
Dimension
|
|
required |
Returns:
| Type | Description |
|---|---|
|
|