Justin Unverricht
02/16/2022, 2:08 AMsum(fact A) / sum (measure B)
is there anyway to modify it to be
sum(fact A) / sum (measure D)
or would would the best way be for me to just create a new arithmeticMeasure with the values I want and plug that into my existing insight?Dan Homola
02/16/2022, 8:30 AMJustin Unverricht
02/16/2022, 8:46 PMDan Homola
02/17/2022, 12:12 PMimport { idRef } from "@gooddata/sdk-model";
import { IObjectExpressionToken } from "@gooddata/sdk-backend-spi";
const tokens = await backend
.workspace(workspace)
.measures()
.getMeasureExpressionTokens(idRef("YOUR_METRIC_ID"));
const relatedFactIds = tokens
.filter((token): token is IObjectExpressionToken => token.type === "fact")
.map((token) => token.id);
similarly for othe object types, the full list is available in the source code. Just a note for the naming: “displayForm” there is what is called “label” in GoodData.CN. I hope this helps 🙂Justin Unverricht
02/17/2022, 6:55 PMDan Homola
02/18/2022, 8:57 AMgetMeasureExpressionTokens
method:
• createMeasure
• updateMeasure
• deleteMeasure
all of those “live” in the backend.workspace(WORKSPACE).measure()
part of the SPI. Check the definitions on GitHub. You provide the MAQL string as teh expression
property of the input objects. I hope this helps 🙂