Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
olapy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
olapy
Commits
25a93b35
Commit
25a93b35
authored
Mar 24, 2017
by
Mouadh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changing generate celldata
parent
c4b2928c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
9 deletions
+27
-9
olapy/core/services/xmla_execute_tools.py
olapy/core/services/xmla_execute_tools.py
+27
-9
No files found.
olapy/core/services/xmla_execute_tools.py
View file @
25a93b35
...
@@ -300,17 +300,35 @@ class XmlaExecuteTools():
...
@@ -300,17 +300,35 @@ class XmlaExecuteTools():
:param mdx_execution_result: mdx_execute() result
:param mdx_execution_result: mdx_execute() result
:return: CellData as string
:return: CellData as string
"""
"""
columns_loop
=
[]
if
mdx_execution_result
[
'columns_desc'
][
'columns'
].
keys
(
)
and
mdx_execution_result
[
'columns_desc'
][
'rows'
].
keys
():
if
self
.
executer
.
facts
in
mdx_execution_result
[
'columns_desc'
][
'columns'
].
keys
()
+
mdx_execution_result
[
'columns_desc'
][
'rows'
].
keys
():
# iterate DataFrame vertically
columns_loop
=
itertools
.
chain
(
*
[
tuple
for
tuple
in
mdx_execution_result
[
'result'
].
itertuples
(
index
=
False
)
])
else
:
# iterate DataFrame horizontally
columns_loop
=
itertools
.
chain
(
*
[
mdx_execution_result
[
'result'
][
measure
]
for
measure
in
mdx_execution_result
[
'result'
].
columns
])
cell_data
=
""
cell_data
=
""
index
=
0
index
=
0
for
tuple
in
mdx_execution_result
[
'result'
].
itertuples
(
index
=
False
):
for
value
in
columns_loop
:
for
value
in
tuple
:
cell_data
+=
"""
cell_data
+=
"""
<Cell CellOrdinal="{0}">
<Cell CellOrdinal="{0}">
<Value xsi:type="xsi:long">{1}</Value>
<Value xsi:type="xsi:long">{1}</Value>
</Cell>
</Cell>
"""
.
format
(
index
,
value
)
"""
.
format
(
index
,
value
)
index
+=
1
index
+=
1
return
cell_data
return
cell_data
def
generate_axes_info_slicer
(
self
,
mdx_execution_result
):
def
generate_axes_info_slicer
(
self
,
mdx_execution_result
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment