Tuples
import { Tuples } from "@skipcheck/tm1-client";Cell coordinates, as TM1 binds them: one element path per dimension of the cube, in the cube's order.
// A budget for North, one value per month, written in one request
const budget = { Jan: 1200, Feb: 1350, Mar: 1100 };
const updates = Object.entries(budget).map(([month, value]) => {
const cell = { Version: "Budget", Region: "North", Month: month, Measure: "Revenue" };
return CubeUpdatePatch.builder()
.bindTuple(...Tuples.of(cell))
.value(value)
.build();
});
return tm1.cells.updateCells("Sales", updates);
Members
of static | The element paths for a cell. |
element static | One element's path, Dimensions('d')/Hierarchies('h')/Elements('e'). |
of
staticstatic of(tuple: Tm1Map<string>): ODataPath[]The element paths for a cell: tuple maps dimension to element, for every dimension of the cube in its order (a Map if a name may look like an integer); each element is in its dimension's same-named hierarchy. One path per element, such as Dimensions('Region')/Hierarchies('Region')/Elements('North').
element
staticstatic element(dimension: string, hierarchy: string, element: string): ODataPathOne element's path, Dimensions('d')/Hierarchies('h')/Elements('e').