skipcheck

TM1 client · Docs · Dimensions and hierarchies

EdgeService

using Skipcheck.Tm1.Client.Services;

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 tm1.Edges.ListAsync("Region", "Region").Select(edge => $"{edge.ParentName} > {edge.ComponentName} ({edge.Weight})");

Change an edge's weight:

// Make Cost count negatively in Margin
await tm1.Edges.UpdateAsync("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
var edge = await tm1.Edges.CreateAsync("Region", "Region", EdgePatch.Builder().ParentName("Total Sales").ComponentName("North").Weight(1.0).Build());
await tm1.Edges.DeleteAsync("Region", "Region", "Total", "North");
return edge;

Members

EdgeService constructorA service that sends its requests through session.
ListAsyncThe hierarchy's edges, streamed.
GetAsyncGET …/Edges(ParentName='p',ComponentName='c').
CreateAsyncLinks a component under a parent, with a weight; returns the edge.
UpdateAsyncChanges the edge, typically its weight.
DeleteAsyncUnlinks the component; the element stays in the hierarchy.
ParentAsyncThe edge's parent element.
ComponentAsyncThe edge's component element.
HierarchyAsyncThe hierarchy the edge belongs to.

EdgeService

constructor
EdgeService(Tm1Session session)

A service that sends its requests through session.

ListAsync

IAsyncEnumerable<Edge> ListAsync(string dimension, string hierarchy, ODataQuery? query = null, CancellationToken cancellationToken = default)

GET Dimensions('d')/Hierarchies('h')/Edges: the hierarchy's edges, streamed.

TM1 REST Navigation Hierarchy/Edges

GetAsync

Task<Edge> GetAsync( string dimension, string hierarchy, string parent, string component, ODataQuery? query = null, CancellationToken cancellationToken = default )

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

TM1 REST Navigation Hierarchy/Edges

CreateAsync

Task<Edge> CreateAsync(string dimension, string hierarchy, EdgePatch edge, CancellationToken cancellationToken = default)

POST …/Edges: links a component under a parent, with a weight; returns the edge.

TM1 REST Navigation Hierarchy/Edges

UpdateAsync

Task UpdateAsync( string dimension, string hierarchy, string parent, string component, EdgePatch patch, CancellationToken cancellationToken = default )

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

TM1 REST Navigation Hierarchy/Edges

DeleteAsync

Task DeleteAsync(string dimension, string hierarchy, string parent, string component, CancellationToken cancellationToken = default)

DELETE …/Edges(ParentName='p',ComponentName='c'): unlinks the component; the element stays in the hierarchy.

TM1 REST Navigation Hierarchy/Edges

ParentAsync

Task<Element> ParentAsync( string dimension, string hierarchy, string parent, string component, ODataQuery? query = null, CancellationToken cancellationToken = default )

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

TM1 REST Navigation Edge/Parent

ComponentAsync

Task<Element> ComponentAsync( string dimension, string hierarchy, string parent, string component, ODataQuery? query = null, CancellationToken cancellationToken = default )

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

TM1 REST Navigation Edge/Component

HierarchyAsync

Task<Hierarchy> HierarchyAsync( string dimension, string hierarchy, string parent, string component, ODataQuery? query = null, CancellationToken cancellationToken = default )

GET …/Edges(…)/Hierarchy: the hierarchy the edge belongs to.

TM1 REST Navigation Edge/Hierarchy