Daanse Tutorial — Writeback with a DECIMAL amount and a text comment.
The minimal writeback example that uses a fixed-precision decimal numeric type (not integer) for the writeable amount column, paired with a free-text comment column. One single-level dimension (Product) supplies the slicing key.
This is the simplest realistic shape for a planning/forecasting cube where users type currency amounts (which require decimal precision) along with explanatory notes.
The cube exposes:
Amount — SumMeasure over a DECIMAL(18,2)AMOUNT column. Currency-formatted.
Comments — TextAggMeasure over a VARCHARCOMMENT column with separator " | ".
Both measures are writeable via the FACTWB writeback table. The runtime detects the text bind type for the Comments measure from its ListAggAggregator; the numeric Amount measure follows the standard allocation path.
Single dimension Product with one ExplicitHierarchy and a single level. The level keys on PRODUCT.KEY and shows PRODUCT.NAME as the displayed member name.
Amount — SumMeasure(FACT.AMOUNT). Note that the underlying column is declared DECIMAL(18, 2) rather than INTEGER, so the writeback binding preserves fractional precision (e.g. tax amounts, currency).
Comments — TextAggMeasure(FACT.COMMENT, separator = " | "). On read the aggregator concatenates every matching comment; on write the runtime takes the text short-path and inserts a single row with the typed string.
Numeric write.Cell.setValue([Measures].[Amount], 19.95, EQUAL_ALLOCATION, ...) → the runtime spreads 19.95 across the cell's leaves per the allocation policy and emits the resulting rows with AMOUNT populated as a decimal.
Text write.Cell.setValue([Measures].[Comments], "promo Q3", ...) → the runtime recognises the TextAggMeasure target, bypasses allocation, and emits exactly one row with COMMENT = "promo Q3" and AMOUNT = NULL. Every writeback row gets ID = UUID() and USER = sessionUser.
Daanse Tutorial - Writeback Decimal + Comment
Daanse Tutorial — Writeback with a DECIMAL amount and a text comment.
The minimal writeback example that uses a fixed-precision decimal numeric type (not integer) for the writeable amount column, paired with a free-text comment column. One single-level dimension (
Product) supplies the slicing key.This is the simplest realistic shape for a planning/forecasting cube where users type currency amounts (which require decimal precision) along with explanatory notes.
The cube exposes:
Amount—SumMeasureover aDECIMAL(18,2)AMOUNTcolumn. Currency-formatted.Comments—TextAggMeasureover aVARCHARCOMMENTcolumn with separator" | ".Both measures are writeable via the
FACTWBwriteback table. The runtime detects the text bind type for theCommentsmeasure from itsListAggAggregator; the numericAmountmeasure follows the standard allocation path.Database Schema
Three tables:
FACT—PRODUCT(VARCHAR),AMOUNT(DECIMAL),COMMENT(VARCHAR). One row per posting.PRODUCT—KEY(VARCHAR),NAME(VARCHAR). The single dimension table; the fact joins onFACT.PRODUCT = PRODUCT.KEY.FACTWB— same dimensional + measure columns asFACT, plusID(VARCHAR, UUID written by the engine) andUSER(VARCHAR, session user).Note: This is only a symbolic example. For the exact definition, see the Definition section.
Fact Query
Plain TableSource over FACT.
Note: This is only a symbolic example. For the exact definition, see the Definition section.
Product dimension
Single dimension
Productwith oneExplicitHierarchyand a single level. The level keys onPRODUCT.KEYand showsPRODUCT.NAMEas the displayed member name.Note: This is only a symbolic example. For the exact definition, see the Definition section.
Measures (decimal Amount + text Comments)
Amount—SumMeasure(FACT.AMOUNT). Note that the underlying column is declaredDECIMAL(18, 2)rather thanINTEGER, so the writeback binding preserves fractional precision (e.g. tax amounts, currency).Comments—TextAggMeasure(FACT.COMMENT, separator = " | "). On read the aggregator concatenates every matching comment; on write the runtime takes the text short-path and inserts a single row with the typed string.Writeback (FACTWB)
Numeric write.
Cell.setValue([Measures].[Amount], 19.95, EQUAL_ALLOCATION, ...)→ the runtime spreads19.95across the cell's leaves per the allocation policy and emits the resulting rows withAMOUNTpopulated as a decimal.Text write.
Cell.setValue([Measures].[Comments], "promo Q3", ...)→ the runtime recognises theTextAggMeasuretarget, bypasses allocation, and emits exactly one row withCOMMENT = "promo Q3"andAMOUNT = NULL. Every writeback row getsID = UUID()andUSER = sessionUser.Note: This is only a symbolic example. For the exact definition, see the Definition section.
Cube C
One physical cube
CoverFACTwith oneDimensionConnectoronProduct, oneMeasureGroupholdingAmountandComments, and theFACTWBwriteback table.Note: This is only a symbolic example. For the exact definition, see the Definition section.
Definition
This file represents the complete definition of the catalog.
Tutorial Zip
This file contains the data-tables as csv and the mapping as xmi file.
Download Zip File