From c8282a129f2ea1c7ebb6a2b0a4dd037bfc2eb28f Mon Sep 17 00:00:00 2001 From: Dmitrij Vladimirov <47441164+Frisle@users.noreply.github.com> Date: Thu, 13 Apr 2023 18:28:28 +0600 Subject: [PATCH 1/3] ADD: New method to get dimension data type Method get data type for time measure. If measure is not time kind of measure it shows fact table(?). Method tested on other widgets. --- MDX2JSON/Dashboard.cls | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/MDX2JSON/Dashboard.cls b/MDX2JSON/Dashboard.cls index 20f8156..1094834 100644 --- a/MDX2JSON/Dashboard.cls +++ b/MDX2JSON/Dashboard.cls @@ -96,6 +96,39 @@ ClassMethod WidgetsToProxyObject(Dashboard As %DeepSee.Dashboard.Definition, Out return st } + +/// A very specific method of displaying the data type for cube measures. +/// Serves for the convenience of front-end development of the filter widget. +/// The return is something like this %DeepSee.Time.DayMonthYear +ClassMethod GetCubeMeasuresDataType(Widget, Number, CubeName, Output DataType As %String) As %Status +{ + + set st = $$$OK + set obj = $$$NewDynObj + set st = Widget.controls.GetAt(Number).%CopyTo(obj) // copy widget control properties to proxyObj + set dataSource = $piece(Widget.dataSource, ".", *) // get dataSource type + + + if (dataSource '= "kpi"){ + if ($FIND(obj.targetProperty, "[")){ + set tMeasure = $TRANSLATE(obj.targetProperty, "[]", "") + + set st = ##class(%DeepSee.Utils).%GetDimensionInfo(CubeName,tMeasure,.pDimNo,.pHierNo,.pLevelNo) // get positional info about dimension + + Set tMbrInfo = $G($$$DeepSeeMetaGLVN("cubes",$$$UPPER(CubeName),"mbr#",pDimNo,pHierNo,pLevelNo)) + set DataType = $LG(tMbrInfo,6) // get data type + }else{ + + set DataType = "" + } + }else{ + + set DataType = "" + } + + return st +} + /// Converts relevant parts of %DeepSee.Dashboard.Widget object into %ZEN.proxyObject. ClassMethod WidgetToProxyObject(Widget As %DeepSee.Dashboard.Widget, CubeName As %String) As %ZEN.proxyObject [ Internal ] { @@ -253,6 +286,9 @@ ClassMethod WidgetControlToProxyObject(Widget As %DeepSee.Dashboard.Widget, Numb set obj.label = ##class(%DeepSee.UserPortal.Utils).%ResolveText(obj.label) set obj.source = Widget.name + set filterDataType = ..GetCubeMeasuresDataType(Widget,Number,CubeName,.fDataType) + set obj.targetPropertyDataType = fDataType + set:(obj.target="") obj.target = Widget.name if ($e(obj.value)="@") { From f33435bf9c3b8c5aae8076a4fabfa47114acd09e Mon Sep 17 00:00:00 2001 From: Dmitrij Vladimirov <47441164+Frisle@users.noreply.github.com> Date: Mon, 17 Apr 2023 10:20:48 +0600 Subject: [PATCH 2/3] Update Dashboard.cls Small change to fix cube fast return --- MDX2JSON/Dashboard.cls | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/MDX2JSON/Dashboard.cls b/MDX2JSON/Dashboard.cls index 1094834..6ad63e2 100644 --- a/MDX2JSON/Dashboard.cls +++ b/MDX2JSON/Dashboard.cls @@ -117,6 +117,10 @@ ClassMethod GetCubeMeasuresDataType(Widget, Number, CubeName, Output DataType As Set tMbrInfo = $G($$$DeepSeeMetaGLVN("cubes",$$$UPPER(CubeName),"mbr#",pDimNo,pHierNo,pLevelNo)) set DataType = $LG(tMbrInfo,6) // get data type + if '($FIND(DataType, "%")){ // if DataType return cube fact search for dataType in "star" + Set tMbrInfo = $G($$$DeepSeeMetaGLVN("cubes", $$$UPPER(CubeName), "star", DataType, "prop", $LG(tMbrInfo,7), "type")) + set DataType = tMbrInfo + } }else{ set DataType = "" From b2fa8a993518546cf879befdbe8f8bf8d686a7bd Mon Sep 17 00:00:00 2001 From: Dmitrij Vladimirov <47441164+Frisle@users.noreply.github.com> Date: Tue, 18 Apr 2023 09:41:00 +0600 Subject: [PATCH 3/3] Update Dashboard.cls removed %CopyTo() --- MDX2JSON/Dashboard.cls | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/MDX2JSON/Dashboard.cls b/MDX2JSON/Dashboard.cls index 6ad63e2..dac7f4a 100644 --- a/MDX2JSON/Dashboard.cls +++ b/MDX2JSON/Dashboard.cls @@ -104,14 +104,11 @@ ClassMethod GetCubeMeasuresDataType(Widget, Number, CubeName, Output DataType As { set st = $$$OK - set obj = $$$NewDynObj - set st = Widget.controls.GetAt(Number).%CopyTo(obj) // copy widget control properties to proxyObj set dataSource = $piece(Widget.dataSource, ".", *) // get dataSource type - if (dataSource '= "kpi"){ - if ($FIND(obj.targetProperty, "[")){ - set tMeasure = $TRANSLATE(obj.targetProperty, "[]", "") + if ($FIND(Widget.controls.GetAt(Number).targetProperty, "[")){ + set tMeasure = $TRANSLATE(Widget.controls.GetAt(Number).targetProperty, "[]", "") set st = ##class(%DeepSee.Utils).%GetDimensionInfo(CubeName,tMeasure,.pDimNo,.pHierNo,.pLevelNo) // get positional info about dimension