Skip to content

Commit 78f29b7

Browse files
authored
Use %ZEN.Auxiliary.altJSONSQLProvider for the processing of MDX Drillthrough queries
Consider this code: ``` set SQL="SELECT '5125.72','1714.50'" do ##class(%ZEN.Auxiliary.jsonSQLProvider).%WriteJSONFromSQL(,SQL) ``` It produces the following output: ``` { "children":[ { "HostVar_1":5125.72, "HostVar_2":"1714.50" } ] } ``` Instead of: ``` { "children":[ { "HostVar_1":5125.72, "HostVar_2":1714.50 } ] } ``` This is because `ZENJSISNUM` macro in `%ZEN.Utils.inc` is used to check if a string is a number. Macro definition is: ``` #define ZENJSISNUM(%val) ($IsValidNum(%val)&&(%val=+(%val))&&(%val <= 9007199254740991)&&(%val >= -9007199254740991)) ``` Note the second condition there: %val=+(%val) It won't evaluate as true for numbers with `0` at the end, such as `1714.50`, which causes it to be interpreted as a string. This commit changes to `%ZEN.Auxiliary.altJSONSQLProvider` which does not have this issue. Fixes #79
1 parent 0f8dd1b commit 78f29b7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

MDX2JSON/Utils.cls.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ Automatic processing of MDX Drillthrough query and outputting resulting listing
168168
return:$$$ISERR(st) st
169169
170170
set SQL = RS.%GetListingSQL()
171-
do ##class(%ZEN.Auxiliary.jsonSQLProvider).%WriteJSONFromSQL(,SQL,,$$$MaxCacheInt)
171+
do ##class(%ZEN.Auxiliary.altJSONSQLProvider).%WriteJSONFromSQL(,SQL,,$$$MaxCacheInt)
172172
173173
return $$$OK
174174
]]></Implementation>

0 commit comments

Comments
 (0)