Skip to content

Commit 34d27b3

Browse files
authored
Merge pull request #105 from Frisle/patch-5
Update ResultSet.cls
2 parents 391b827 + dedbf9c commit 34d27b3

1 file changed

Lines changed: 9 additions & 17 deletions

File tree

MDX2JSON/ResultSet.cls

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ Method ProcessOneAxisCell(CubeIndex, AxisKey, CubeName, QueryKey, AxisNumber, No
151151
}
152152

153153
//To filter out invisible сells
154-
if (..IsCellNull(cell, AxisNumber, Node)=1) {
154+
if (..IsCellNull(cell)=1) {
155155
return cell.children
156156
}
157157

@@ -198,30 +198,22 @@ Method ProcessOneAxisCell(CubeIndex, AxisKey, CubeName, QueryKey, AxisNumber, No
198198
return cell
199199
}
200200

201-
/// Determine if cell is an invisyble system cell.
202-
Method IsCellNull(Cell, AxisNumber, Node)
201+
/// Determine if cell is an invisible system cell.
202+
Method IsCellNull(Cell)
203203
{
204-
return:((Cell.type = "axis") || (Cell.type = "set")) 1 // for top-level cells
205-
204+
206205
return:(Cell.caption=0) 1 // typical caption for top-level cell
207206
return:(Cell.caption=1) 1 // typical caption for top-level cell
208207
return:(Cell.caption="") 1 // typical caption for top-level cell
209208
//return:(caption'="") 0
210209
//return:(path="") 1
211210
set children = Cell.children
212211
return:(($isobject(children)) && ($$$ListSize(children)>0)) 0 // cell has children
213-
214-
if (Cell.type'="lit") {
215-
set key = $O($$$DeepSeeResultsGLVN(..%CubeKey, ..%QueryKey, "leaf", AxisNumber, ""))
216-
while (key'="") {
217-
return:(Node=$$$DeepSeeResultsGLVN(..%CubeKey, ..%QueryKey, "leaf", AxisNumber, key)) 0 //for leafs
218-
set key = $O($$$DeepSeeResultsGLVN(..%CubeKey, ..%QueryKey, "leaf", AxisNumber, key))
219-
}
220-
} else {
221-
/// lit cell: SELECT %LABEL("Const","Title") ON 0 FROM [HoleFoodsBudget]
222-
/// but also a lot of top-pevel cells
223-
return 'Cell.vis
224-
}
212+
213+
// in case of cell type='lit'. the 'lit' cell always has the value vis=0, so we can skip it
214+
// this is also true for type='axis' and type='set' so there is no need to check everything individually
215+
return:(Cell.vis '= 0) 0
216+
225217

226218
return 1
227219
}

0 commit comments

Comments
 (0)