ElementService
ElementService(rest)
Bases: ObjectService
Service to handle Object Updates for TM1 Dimension (resp. Hierarchy) Elements
Source code in TM1py/Services/ElementService.py
add_edges(dimension_name, hierarchy_name=None, edges=None, use_blob=False, remove_blob=True, **kwargs)
Add Edges to hierarchy. Fails if one edge already exists.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dimension_name
|
str
|
|
required |
hierarchy_name
|
str
|
|
None
|
edges
|
Dict[Tuple[str, str], int]
|
A dict mapping (parent, component) tuples to the edge weight. |
None
|
use_blob
|
bool
|
Add the edges via an uploaded CSV blob + unbound TI process. Requires admin permissions. Better performance on large edge sets. Returns None instead of a Response. |
False
|
remove_blob
|
bool
|
Remove the staged blob file after use (only with use_blob=True, default: True). |
True
|
Returns:
| Type | Description |
|---|---|
Optional[Response]
|
|
Source code in TM1py/Services/ElementService.py
add_edges_use_blob(dimension_name, hierarchy_name=None, edges=None, remove_blob=True, **kwargs)
Add edges to a hierarchy via an unbound TI process having an uploaded CSV as the data source.
Mirrors add_edges but scales better to large edge sets. Edges that already exist surface as
minor errors (raised as TM1pyWritePartialFailureException).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dimension_name
|
str
|
The name of the dimension. |
required |
hierarchy_name
|
str
|
The name of the hierarchy. Defaults to the dimension name. |
None
|
edges
|
Dict[Tuple[str, str], int]
|
A dict mapping (parent, component) tuples to the edge weight. |
None
|
remove_blob
|
bool
|
Remove the staged blob file after use (default: True). |
True
|
Returns:
| Type | Description |
|---|---|
|
None |
Source code in TM1py/Services/ElementService.py
add_element_attributes(dimension_name, hierarchy_name, element_attributes, **kwargs)
Add element attributes to hierarchy. Fails if one element attribute already exists.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dimension_name
|
str
|
|
required |
hierarchy_name
|
str
|
|
required |
element_attributes
|
List[ElementAttribute]
|
|
required |
Returns:
| Type | Description |
|---|---|
|
|
Source code in TM1py/Services/ElementService.py
add_elements(dimension_name, hierarchy_name, elements, use_blob=False, remove_blob=True, **kwargs)
Add elements to hierarchy. Fails if one element already exists.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dimension_name
|
str
|
|
required |
hierarchy_name
|
str
|
|
required |
elements
|
Iterable[Element]
|
|
required |
use_blob
|
bool
|
Add the elements via an uploaded CSV blob + unbound TI process. Requires admin permissions. Better performance on large element sets. Returns None instead of a Response. |
False
|
remove_blob
|
bool
|
Remove the staged blob file after use (only with use_blob=True, default: True). |
True
|
Returns:
| Type | Description |
|---|---|
Optional[Response]
|
|
Source code in TM1py/Services/ElementService.py
add_elements_use_blob(dimension_name, hierarchy_name, elements, remove_blob=True, **kwargs)
Add elements to a hierarchy via an unbound TI process having an uploaded CSV as the data source.
Mirrors add_elements but scales better to large element sets. Elements that already exist
surface as minor errors (raised as TM1pyWritePartialFailureException).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dimension_name
|
str
|
The name of the dimension. |
required |
hierarchy_name
|
str
|
The name of the hierarchy. |
required |
elements
|
Iterable[Element]
|
An iterable of Element objects to add. |
required |
remove_blob
|
bool
|
Remove the staged blob file after use (default: True). |
True
|
Returns:
| Type | Description |
|---|---|
|
None |
Source code in TM1py/Services/ElementService.py
attribute_cube_exists(dimension_name, **kwargs)
create(dimension_name, hierarchy_name, element, **kwargs)
Source code in TM1py/Services/ElementService.py
create_element_attribute(dimension_name, hierarchy_name, element_attribute, **kwargs)
like AttrInsert
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dimension_name
|
str
|
|
required |
hierarchy_name
|
str
|
|
required |
element_attribute
|
ElementAttribute
|
instance of TM1py.ElementAttribute |
required |
Returns:
| Type | Description |
|---|---|
Response
|
|
Source code in TM1py/Services/ElementService.py
delete(dimension_name, hierarchy_name, element_name, **kwargs)
Source code in TM1py/Services/ElementService.py
delete_edges(dimension_name, hierarchy_name, edges=None, use_ti=False, use_blob=False, remove_blob=True, skip_invalid_edges=True, **kwargs)
Remove edges in TM1.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dimension_name
|
str
|
The name of the dimension. |
required |
hierarchy_name
|
str
|
The name of the hierarchy. |
required |
edges
|
Iterable[Tuple[str, str]]
|
A list of tuples representing the edges to remove, where each tuple contains a parent and a child. |
None
|
use_ti
|
bool
|
A boolean indicating whether to use a TI process to delete edges (default: False). |
False
|
use_blob
|
bool
|
A boolean indicating whether to use a blob file to delete edges (default: False). |
False
|
remove_blob
|
bool
|
A boolean indicating whether to remove the parent-child file after use (default: True). |
True
|
skip_invalid_edges
|
bool
|
A boolean indicating whether to skip invalid edges (default: True). |
True
|
Source code in TM1py/Services/ElementService.py
delete_edges_use_blob(dimension_name, hierarchy_name, edges=None, remove_blob=True, skip_invalid_edges=True, **kwargs)
Remove edges in TM1 via an unbound TI process having an uploaded CSV as the data source.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dimension_name
|
str
|
The name of the dimension. |
required |
hierarchy_name
|
str
|
The name of the hierarchy. |
required |
edges
|
List[str]
|
A list of tuples representing the edges to remove, where each tuple contains a parent and a child. |
None
|
remove_blob
|
bool
|
A boolean indicating whether to remove the parent-child file after use (default: True). |
True
|
skip_invalid_edges
|
bool
|
A boolean indicating whether to skip invalid edges (default: True). |
True
|
kwargs
|
Additional arguments for the process execution. |
{}
|
Returns:
| Type | Description |
|---|---|
|
None |
Source code in TM1py/Services/ElementService.py
delete_edges_use_ti(dimension_name, hierarchy_name, edges=None, skip_invalid_edges=True, **kwargs)
Remove edges in TM1 via an unbound TI process.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dimension_name
|
str
|
The name of the dimension. |
required |
hierarchy_name
|
str
|
The name of the hierarchy. |
required |
edges
|
List[str]
|
A list of tuples representing the edges to remove, where each tuple contains a parent and a child. |
None
|
skip_invalid_edges
|
bool
|
A boolean indicating whether to skip invalid edges (default: True). |
True
|
Source code in TM1py/Services/ElementService.py
delete_element_attribute(dimension_name, hierarchy_name, element_attribute, **kwargs)
like AttrDelete
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dimension_name
|
str
|
|
required |
hierarchy_name
|
str
|
|
required |
element_attribute
|
str
|
instance of TM1py.ElementAttribute |
required |
Returns:
| Type | Description |
|---|---|
Response
|
|
Source code in TM1py/Services/ElementService.py
delete_elements(dimension_name, hierarchy_name, element_names=None, use_ti=False, **kwargs)
Source code in TM1py/Services/ElementService.py
delete_elements_use_ti(dimension_name, hierarchy_name, element_names=None, **kwargs)
Source code in TM1py/Services/ElementService.py
element_is_ancestor(dimension_name, hierarchy_name, ancestor_name, element_name, method=None)
Element is Ancestor
:Note, unlike the related function in TM1 (ELISANC or ElementIsAncestor), this function will return False
if an invalid element is passed; but will raise an exception if an invalid dimension, or hierarchy is passed
For method you can pass 3 three values
value TI performs best, but requires admin permissions
Value 'TM1DrillDownMember' performs well when element is a leaf.
Value 'Descendants' performs well when ancestor_name and element_name are Consolidations.
If no value is passed, function defaults to 'TI' for user with admin permissions and 'TM1DrillDownMember' for users without admin permissions
Source code in TM1py/Services/ElementService.py
element_is_parent(dimension_name, hierarchy_name, parent_name, element_name)
Element is Parent :Note, unlike the related function in TM1 (ELISPAR or ElementIsParent), this function will return False :if an invalid element is passed; :but will raise an exception if an invalid dimension, or hierarchy is passed
Source code in TM1py/Services/ElementService.py
element_lock(dimension_name, hierarchy_name, element_name, **kwargs)
Lock element
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dimension_name
|
str
|
Name of dimension. |
required |
hierarchy_name
|
str
|
Name of hierarchy. |
required |
element_name
|
str
|
Name of element to lock. |
required |
Returns:
| Type | Description |
|---|---|
Response
|
response |
Source code in TM1py/Services/ElementService.py
element_unlock(dimension_name, hierarchy_name, element_name, **kwargs)
Unlock element
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dimension_name
|
str
|
Name of dimension. |
required |
hierarchy_name
|
str
|
Name of hierarchy. |
required |
element_name
|
str
|
Name of element to unlock. |
required |
Returns:
| Type | Description |
|---|---|
Response
|
response |
Source code in TM1py/Services/ElementService.py
execute_set_mdx(mdx, top_records=None, member_properties=('Name', 'Weight'), parent_properties=('Name', 'UniqueName'), element_properties=('Type', 'Level'), **kwargs)
:method to execute an MDX statement against a dimension
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mdx
|
str
|
valid dimension mdx statement |
required |
top_records
|
Optional[int]
|
number of records to return, default: all elements no limit |
None
|
member_properties
|
Optional[Iterable[str]]
|
list of member properties (e.g., Name, UniqueName, Type, Weight, Attributes/Color) to return, will always return the Name property |
('Name', 'Weight')
|
parent_properties
|
Optional[Iterable[str]]
|
list of parent properties (e.g., Name, UniqueName, Type, Weight, Attributes/Color) to return, can be None or empty |
('Name', 'UniqueName')
|
element_properties
|
Optional[Iterable[str]]
|
list of element properties (e.g., Name, UniqueName, Type, Level, Index, Attributes/Color) to return, can be empty |
('Type', 'Level')
|
Returns:
| Type | Description |
|---|---|
List
|
dictionary of members, unique names, weights, types, and parents or async id when return_async_id is True |
Source code in TM1py/Services/ElementService.py
1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 | |
execute_set_mdx_element_names(mdx, top_records=None, **kwargs)
:method to execute an MDX statement against a dimension and get a list with element names back
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mdx
|
str
|
valid dimension mdx statement |
required |
top_records
|
Optional[int]
|
number of records to return, default: all elements no limit |
None
|
Returns:
| Type | Description |
|---|---|
List
|
list of element names |
Source code in TM1py/Services/ElementService.py
exists(dimension_name, hierarchy_name, element_name, **kwargs)
Source code in TM1py/Services/ElementService.py
get(dimension_name, hierarchy_name, element_name, **kwargs)
Source code in TM1py/Services/ElementService.py
get_alias_element_attributes(dimension_name, hierarchy_name, **kwargs)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dimension_name
|
str
|
|
required |
hierarchy_name
|
str
|
|
required |
Returns:
| Type | Description |
|---|---|
List[str]
|
|
Source code in TM1py/Services/ElementService.py
get_all_element_identifiers(dimension_name, hierarchy_name, **kwargs)
Get all element names and alias values in a hierarchy
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dimension_name
|
str
|
|
required |
hierarchy_name
|
str
|
|
required |
Returns:
| Type | Description |
|---|---|
CaseAndSpaceInsensitiveSet
|
|
Source code in TM1py/Services/ElementService.py
get_all_leaf_element_identifiers(dimension_name, hierarchy_name, **kwargs)
Get all element names and alias values for leaf elements in a hierarchy
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dimension_name
|
str
|
|
required |
hierarchy_name
|
str
|
|
required |
Returns:
| Type | Description |
|---|---|
CaseAndSpaceInsensitiveSet
|
|
Source code in TM1py/Services/ElementService.py
get_attribute_of_elements(dimension_name, hierarchy_name, attribute, elements=None, exclude_empty_cells=True, element_unique_names=False)
Get element name and attribute value for a set of elements in a hierarchy
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dimension_name
|
str
|
|
required |
hierarchy_name
|
str
|
|
required |
attribute
|
str
|
Name of the Attribute |
required |
elements
|
Union[str, List[str]]
|
MDX (Set) expression or iterable of elements |
None
|
exclude_empty_cells
|
bool
|
Boolean |
True
|
element_unique_names
|
bool
|
Boolean |
False
|
Returns:
| Type | Description |
|---|---|
dict
|
Dict {'01':'Jan', '02':'Feb'} |
Source code in TM1py/Services/ElementService.py
get_consolidated_element_names(dimension_name, hierarchy_name, **kwargs)
Source code in TM1py/Services/ElementService.py
get_consolidated_elements(dimension_name, hierarchy_name, **kwargs)
Source code in TM1py/Services/ElementService.py
get_edges(dimension_name, hierarchy_name, **kwargs)
Source code in TM1py/Services/ElementService.py
get_edges_under_consolidation(dimension_name, hierarchy_name, consolidation, max_depth=None, **kwargs)
Get all members under a consolidated element
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dimension_name
|
str
|
name of dimension |
required |
hierarchy_name
|
str
|
name of hierarchy |
required |
consolidation
|
str
|
name of consolidated Element |
required |
max_depth
|
int
|
99 if not passed |
None
|
Returns:
| Type | Description |
|---|---|
List[str]
|
|
Source code in TM1py/Services/ElementService.py
get_element_attribute_names(dimension_name, hierarchy_name, **kwargs)
Get element attributes from hierarchy
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dimension_name
|
str
|
|
required |
hierarchy_name
|
str
|
|
required |
Returns:
| Type | Description |
|---|---|
List[str]
|
|
Source code in TM1py/Services/ElementService.py
get_element_attributes(dimension_name, hierarchy_name, **kwargs)
Get element attributes from hierarchy
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dimension_name
|
str
|
|
required |
hierarchy_name
|
str
|
|
required |
Returns:
| Type | Description |
|---|---|
List[ElementAttribute]
|
|
Source code in TM1py/Services/ElementService.py
get_element_identifiers(dimension_name, hierarchy_name, elements, **kwargs)
Get all element names and alias values for a set of elements in a hierarchy
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dimension_name
|
str
|
|
required |
hierarchy_name
|
str
|
|
required |
elements
|
Union[str, List[str]]
|
MDX (Set) expression or iterable of elements |
required |
Returns:
| Type | Description |
|---|---|
CaseAndSpaceInsensitiveSet
|
|
Source code in TM1py/Services/ElementService.py
get_element_names(dimension_name, hierarchy_name, element_type=None, name_pattern=None, level=None, **kwargs)
Get all element names, optionally filtered.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dimension_name
|
str
|
Name of the dimension. |
required |
hierarchy_name
|
str
|
Name of the hierarchy. |
required |
element_type
|
Optional[Union[int, str, Types, Iterable]]
|
Restrict to elements of the given type(s). Accepts an
|
None
|
name_pattern
|
Optional[str]
|
Restrict to elements whose name matches the glob pattern.
Supports |
None
|
level
|
Optional[int]
|
Restrict to elements at the given hierarchy level (0 = leaf). |
None
|
Returns:
| Type | Description |
|---|---|
List[str]
|
List of element names. |
Source code in TM1py/Services/ElementService.py
get_element_principal_name(dimension_name, hierarchy_name, element_name, **kwargs)
get_element_types(dimension_name, hierarchy_name, skip_consolidations=False, **kwargs)
Source code in TM1py/Services/ElementService.py
get_element_types_from_all_hierarchies(dimension_name, skip_consolidations=False, **kwargs)
Source code in TM1py/Services/ElementService.py
get_elements(dimension_name, hierarchy_name, element_type=None, name_pattern=None, level=None, **kwargs)
Get all elements as Element objects, optionally filtered.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dimension_name
|
str
|
Name of the dimension. |
required |
hierarchy_name
|
str
|
Name of the hierarchy. |
required |
element_type
|
Optional[Union[int, str, Types, Iterable]]
|
Restrict to elements of the given type(s). Accepts an
|
None
|
name_pattern
|
Optional[str]
|
Restrict to elements whose name matches the glob pattern.
Supports |
None
|
level
|
Optional[int]
|
Restrict to elements at the given hierarchy level (0 = leaf). |
None
|
Returns:
| Type | Description |
|---|---|
List[Element]
|
List of Element objects. |
Source code in TM1py/Services/ElementService.py
get_elements_by_level(dimension_name, hierarchy_name, level, **kwargs)
Get all element names by level in a hierarchy.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dimension_name
|
str
|
Name of the dimension |
required |
hierarchy_name
|
str
|
Name of the hierarchy |
required |
level
|
int
|
Level to filter |
required |
Returns:
| Type | Description |
|---|---|
List[str]
|
List of element names |
Source code in TM1py/Services/ElementService.py
get_elements_dataframe(dimension_name=None, hierarchy_name=None, elements=None, skip_consolidations=True, attributes=None, attribute_column_prefix='', skip_parents=False, level_names=None, parent_attribute=None, skip_weights=False, use_blob=False, allow_empty_alias=True, attribute_suffix=False, element_type_column='Type', element_type=None, name_pattern=None, level=None, **kwargs)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dimension_name
|
str
|
Name of the dimension. Can be derived from elements MDX |
None
|
hierarchy_name
|
str
|
Name of the hierarchy in the dimension.Can be derived from elements MDX |
None
|
elements
|
Union[str, Iterable[str]]
|
Selection of members. Iterable or valid MDX string |
None
|
skip_consolidations
|
bool
|
Boolean flag to skip consolidations |
True
|
attributes
|
Iterable[str]
|
Selection of attributes. Iterable. If None retrieve all. |
None
|
attribute_column_prefix
|
str
|
string to prefix attribute colums to avoid name conflicts |
''
|
level_names
|
List[str]
|
List of labels for parent columns. If None use level names from TM1. |
None
|
skip_parents
|
bool
|
Boolean Flag to skip parent columns. |
False
|
parent_attribute
|
str
|
Attribute to be displayed in parent columns. If None, parent name is used. |
None
|
skip_weights
|
bool
|
include weight columns |
False
|
use_blob
|
bool
|
Up to 40% better performance and lower memory footprint in any case. Requires admin permissions |
False
|
allow_empty_alias
|
bool
|
False if empty alias values should be substituted with element names instead |
True
|
attribute_suffix
|
bool
|
True if attribute columns should have ':a', ':s' or ':n' suffix |
False
|
element_type_column
|
str
|
The column name in the df which specifies which element is which type. |
'Type'
|
element_type
|
Optional[Union[int, str, Types, Iterable]]
|
Restrict to elements of the given type(s). Accepts an
|
None
|
name_pattern
|
Optional[str]
|
Restrict to elements whose name matches the glob pattern
( |
None
|
level
|
Optional[int]
|
Restrict to elements at the given hierarchy level (0 = leaf).
Only applied when |
None
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
pandas DataFrame |
Source code in TM1py/Services/ElementService.py
389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 | |
get_elements_filtered_by_attribute(dimension_name, hierarchy_name, attribute_name, attribute_value, **kwargs)
Get all elements from a hierarchy with given attribute value
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dimension_name
|
str
|
|
required |
hierarchy_name
|
str
|
|
required |
attribute_name
|
str
|
|
required |
attribute_value
|
Union[str, float]
|
|
required |
Returns:
| Type | Description |
|---|---|
List[str]
|
List of element names |
Source code in TM1py/Services/ElementService.py
get_elements_filtered_by_wildcard(dimension_name, hierarchy_name, wildcard, level=None, **kwargs)
Get all element names filtered by wildcard (case- and space-insensitive contains) and optional level.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dimension_name
|
str
|
Name of the dimension |
required |
hierarchy_name
|
str
|
Name of the hierarchy |
required |
wildcard
|
str
|
substring to match (case- and space-insensitive contains) |
required |
level
|
int
|
Optional level to filter |
None
|
Returns:
| Type | Description |
|---|---|
List[str]
|
List of element names |
Source code in TM1py/Services/ElementService.py
get_leaf_element_names(dimension_name, hierarchy_name, **kwargs)
Source code in TM1py/Services/ElementService.py
get_leaf_elements(dimension_name, hierarchy_name, **kwargs)
Source code in TM1py/Services/ElementService.py
get_leaves_under_consolidation(dimension_name, hierarchy_name, consolidation, max_depth=None, **kwargs)
Get all leaves under a consolidated element
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dimension_name
|
str
|
name of dimension |
required |
hierarchy_name
|
str
|
name of hierarchy |
required |
consolidation
|
str
|
name of consolidated Element |
required |
max_depth
|
int
|
99 if not passed |
None
|
Returns:
| Type | Description |
|---|---|
List[str]
|
|
Source code in TM1py/Services/ElementService.py
get_level_names(dimension_name, hierarchy_name, descending=True, **kwargs)
Source code in TM1py/Services/ElementService.py
get_levels_count(dimension_name, hierarchy_name, **kwargs)
Source code in TM1py/Services/ElementService.py
get_members_under_consolidation(dimension_name, hierarchy_name, consolidation, max_depth=None, leaves_only=False, **kwargs)
Get all members under a consolidated element
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dimension_name
|
str
|
name of dimension |
required |
hierarchy_name
|
str
|
name of hierarchy |
required |
consolidation
|
str
|
name of consolidated Element |
required |
max_depth
|
int
|
99 if not passed |
None
|
leaves_only
|
bool
|
Only Leaf Elements or all Elements |
False
|
Returns:
| Type | Description |
|---|---|
List[str]
|
|
Source code in TM1py/Services/ElementService.py
get_number_of_consolidated_elements(dimension_name, hierarchy_name, **kwargs)
Source code in TM1py/Services/ElementService.py
get_number_of_elements(dimension_name, hierarchy_name, **kwargs)
Source code in TM1py/Services/ElementService.py
get_number_of_leaf_elements(dimension_name, hierarchy_name, **kwargs)
Source code in TM1py/Services/ElementService.py
get_number_of_numeric_elements(dimension_name, hierarchy_name, **kwargs)
Source code in TM1py/Services/ElementService.py
get_number_of_string_elements(dimension_name, hierarchy_name, **kwargs)
Source code in TM1py/Services/ElementService.py
get_numeric_element_names(dimension_name, hierarchy_name, **kwargs)
Source code in TM1py/Services/ElementService.py
get_numeric_elements(dimension_name, hierarchy_name, **kwargs)
Source code in TM1py/Services/ElementService.py
get_parents(dimension_name, hierarchy_name, element_name, **kwargs)
Source code in TM1py/Services/ElementService.py
get_parents_of_all_elements(dimension_name, hierarchy_name, **kwargs)
Source code in TM1py/Services/ElementService.py
get_process_service()
get_string_element_names(dimension_name, hierarchy_name, **kwargs)
Source code in TM1py/Services/ElementService.py
get_string_elements(dimension_name, hierarchy_name, **kwargs)
Source code in TM1py/Services/ElementService.py
hierarchy_exists(dimension_name, hierarchy_name)
remove_edge(dimension_name, hierarchy_name, parent, component, **kwargs)
Remove one edge from hierarchy. Fails if parent or child element doesn't exist.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dimension_name
|
str
|
|
required |
hierarchy_name
|
str
|
|
required |
parent
|
str
|
|
required |
component
|
str
|
|
required |
Returns:
| Type | Description |
|---|---|
Response
|
|
Source code in TM1py/Services/ElementService.py
update(dimension_name, hierarchy_name, element, **kwargs)
Source code in TM1py/Services/ElementService.py
update_or_create(dimension_name, hierarchy_name, element, **kwargs)
Source code in TM1py/Services/ElementService.py
MDXDrillMethod
Bases: Enum