skipcheck

TM1 client · Docs · Dimensions and hierarchies

EdgeService

from skipcheck_tm1.services import EdgeService

Edges: /Dimensions('d')/Hierarchies('h')/Edges, the parent-child links of a hierarchy, each keyed by its parent's and its component's names.

List a hierarchy's edges:

# Every parent-child link of the hierarchy, as "parent > child (weight)"
return [f"{edge.parent_name} > {edge.component_name} ({edge.weight})" for edge in tm1.edges.list("Region", "Region")]

Change an edge's weight:

# Make Cost count negatively in Margin
tm1.edges.update("Account", "Account", "Margin", "Cost", EdgePatch.builder().weight(-1.0).build())

Move an element to another parent:

# Move North from Total to Total Sales: add the new edge, then delete the old
edge = tm1.edges.create("Region", "Region", EdgePatch.builder().parent_name("Total Sales").component_name("North").weight(1.0).build())
tm1.edges.delete("Region", "Region", "Total", "North")
return edge

The asyncio flavor, skipcheck_tm1.aio, has the same methods to await, on AsyncEdgeService.

Members

listGET …/Hierarchies('h')/Edges.
getGET …/Edges(ParentName='p',ComponentName='c').
createMakes an element a child of a consolidation.
updateChanges the edge's weight.
deleteTakes an element out of a consolidation; the element stays in the hierarchy.
parentGET …/Edges(…)/Parent.
componentGET …/Edges(…)/Component.
hierarchyGET …/Edges(…)/Hierarchy.

list

list(dimension: str, hierarchy: str, query: ODataQuery | None = None, **options: Any) -> list[Edge]

GET …/Hierarchies('h')/Edges.

TM1 REST Navigation Hierarchy/Edges

get

get(dimension: str, hierarchy: str, parent: str, component: str, query: ODataQuery | None = None, **options: Any) -> Edge

GET …/Edges(ParentName='p',ComponentName='c').

TM1 REST Navigation Hierarchy/Edges

create

create(dimension: str, hierarchy: str, edge: Any) -> Edge

POST …/Edges: makes an element a child of a consolidation.

TM1 REST Navigation Hierarchy/Edges

update

update(dimension: str, hierarchy: str, parent: str, component: str, patch: Any) -> None

PATCH …/Edges(ParentName='p',ComponentName='c'): changes the edge's weight.

TM1 REST Navigation Hierarchy/Edges

delete

delete(dimension: str, hierarchy: str, parent: str, component: str) -> None

DELETE …/Edges(ParentName='p',ComponentName='c'): takes an element out of a consolidation; the element stays in the hierarchy.

TM1 REST Navigation Hierarchy/Edges

parent

parent(dimension: str, hierarchy: str, parent: str, component: str, query: ODataQuery | None = None, **options: Any) -> Element

GET …/Edges(…)/Parent.

TM1 REST Navigation Edge/Parent

component

component(dimension: str, hierarchy: str, parent: str, component: str, query: ODataQuery | None = None, **options: Any) -> Element

GET …/Edges(…)/Component.

TM1 REST Navigation Edge/Component

hierarchy

hierarchy(dimension: str, hierarchy: str, parent: str, component: str, query: ODataQuery | None = None, **options: Any) -> Hierarchy

GET …/Edges(…)/Hierarchy.

TM1 REST Navigation Edge/Hierarchy