skipcheck

TM1 client · Docs · Dimensions and hierarchies

EdgeService

import { EdgeService } from "@skipcheck/tm1-client";

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)"
const edges = await tm1.edges.list("Region", "Region").toArray();
return edges.map((edge) => `${edge.ParentName} > ${edge.ComponentName} (${edge.Weight})`);

Change an edge's weight:

// Make Cost count negatively in Margin
return tm1.edges.update("Account", "Account", "Margin", "Cost", EdgePatch.builder().weight(-1).build());

Move an element to another parent:

// Move North from Total to Total Sales: add the new edge, then delete the old
const edge = await tm1.edges.create("Region", "Region", EdgePatch.builder().parentName("Total Sales").componentName("North").weight(1).build());
await tm1.edges.delete("Region", "Region", "Total", "North");
return edge;

Members

listGET …/Hierarchies('h')/Edges, streamed.
getThe edge, or a Tm1NotFoundException if there's none.
createMakes an element a child of a consolidation (parent, component and, optionally, weight); returns the edge as created.
updateChanges the edge's weight.
deleteTakes an element out of a consolidation; the element stays in the hierarchy.
parentThe edge's parent.
componentThe edge's component.
hierarchyThe edge's hierarchy.

list

list(dimension: string, hierarchy: string, query?: ODataQuery | null, options?: Tm1CallOptions): Tm1Stream<Edge>

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

TM1 REST Navigation Hierarchy/Edges

get

get(dimension: string, hierarchy: string, parent: string, component: string, query?: ODataQuery | null, options?: Tm1CallOptions): Promise<Edge>

GET …/Edges(ParentName='p',ComponentName='c'): the edge, or a Tm1NotFoundException if there's none.

TM1 REST Navigation Hierarchy/Edges

create

create(dimension: string, hierarchy: string, edge: EdgePatch, options?: Tm1CallOptions): Promise<Edge>

POST …/Edges: makes an element a child of a consolidation (parent, component and, optionally, weight); returns the edge as created.

TM1 REST Navigation Hierarchy/Edges

update

update(dimension: string, hierarchy: string, parent: string, component: string, patch: EdgePatch, options?: Tm1CallOptions): Promise<void>

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

TM1 REST Navigation Hierarchy/Edges

delete

delete(dimension: string, hierarchy: string, parent: string, component: string, options?: Tm1CallOptions): Promise<void>

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: string, hierarchy: string, parent: string, component: string, query?: ODataQuery | null, options?: Tm1CallOptions): Promise<Element>

GET …/Edges(…)/Parent: the edge's parent.

TM1 REST Navigation Edge/Parent

component

component(dimension: string, hierarchy: string, parent: string, component: string, query?: ODataQuery | null, options?: Tm1CallOptions): Promise<Element>

GET …/Edges(…)/Component: the edge's component.

TM1 REST Navigation Edge/Component

hierarchy

hierarchy(dimension: string, hierarchy: string, parent: string, component: string, query?: ODataQuery | null, options?: Tm1CallOptions): Promise<Hierarchy>

GET …/Edges(…)/Hierarchy: the edge's hierarchy.

TM1 REST Navigation Edge/Hierarchy