Commit 9927e268 authored by Mouadh's avatar Mouadh

fix generate celldata

parent 47529e6d
...@@ -110,10 +110,10 @@ class XmlaExecuteTools(): ...@@ -110,10 +110,10 @@ class XmlaExecuteTools():
'columns'] and mdx_execution_result['columns_desc']['rows']: 'columns'] and mdx_execution_result['columns_desc']['rows']:
# ['Geography','America'] # ['Geography','America']
tuples = [ tuples = [
zip(*[[[key] + list(row) zip(* [[[key] + list(row)
for row in splited_df[key].itertuples(index=False)] for row in splited_df[key].itertuples(index=False)]
for key in splited_df.keys() for key in splited_df.keys()
if key is not self.executer.facts]) if key is not self.executer.facts])
] ]
first_att = 2 first_att = 2
...@@ -122,10 +122,10 @@ class XmlaExecuteTools(): ...@@ -122,10 +122,10 @@ class XmlaExecuteTools():
else: else:
# ['Geography','Amount','America'] # ['Geography','Amount','America']
tuples = [ tuples = [
zip(*[[[key] + [mes] + list(row) zip(* [[[key] + [mes] + list(row)
for row in splited_df[key].itertuples(index=False)] for row in splited_df[key].itertuples(index=False)]
for key in splited_df.keys() for key in splited_df.keys()
if key is not self.executer.facts]) if key is not self.executer.facts])
for mes in self.executer.selected_measures for mes in self.executer.selected_measures
] ]
first_att = 3 first_att = 3
...@@ -302,14 +302,15 @@ class XmlaExecuteTools(): ...@@ -302,14 +302,15 @@ class XmlaExecuteTools():
""" """
cell_data = "" cell_data = ""
index = 0 index = 0
for measure in mdx_execution_result['result'].columns.values: for tuple in mdx_execution_result['result'].itertuples(index=False):
for value in mdx_execution_result['result'][measure]: 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):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment