From d9da648130da2358a18c68d448c93108583b9bed Mon Sep 17 00:00:00 2001 From: Tobias Linsefors Date: Tue, 9 Jun 2020 10:00:52 +0200 Subject: [PATCH] fix: handle when qNumFormat is null when the master measure formatting feature is in sense. It may cause qNumFormat to be null so handle that case --- src/converthypercube.js | 2 +- src/dataset.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/converthypercube.js b/src/converthypercube.js index 328526e..51955f3 100644 --- a/src/converthypercube.js +++ b/src/converthypercube.js @@ -73,7 +73,7 @@ class ConvertHypercube { qMax: max, //mesInfo.qMax, qMin: min, //mesInfo.qMin, qSortIndicator: mesInfo.qSortIndicator, - qNumFormat: { + qNumFormat: mesInfo.qNumFormat && { qDec: mesInfo.qNumFormat.qDec, qFmt: mesInfo.qNumFormat.qFmt, qThou: mesInfo.qNumFormat.qThou, diff --git a/src/dataset.js b/src/dataset.js index c0f7368..17473f0 100644 --- a/src/dataset.js +++ b/src/dataset.js @@ -24,7 +24,7 @@ export async function initVarianceCube(component, layout) { const measures = hyperCubeDef.qMeasures; let expression; - if (JSON.stringify(measures[0].qDef.qNumFormat) === JSON.stringify(measures[1].qDef.qNumFormat)) { + if (JSON.stringify(measures[0].qDef.qNumFormat) === JSON.stringify(measures[1].qDef.qNumFormat) && measures[0].qDef.qNumFormat) { let formatter; switch (measures[0].qDef.qNumFormat.qType) { case "D":