Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_execute_mdx_csv_with_calculated_member(self):
# MDX Query with calculated MEMBER
mdx = MdxBuilder.from_cube(CUBE_NAME).with_member(CalculatedMember.lookup_attribute(
DIMENSION_NAMES[1],
DIMENSION_NAMES[1],
"Calculated Member",
DIMENSION_NAMES[0],
"Attr3")) \
.add_hierarchy_set_to_row_axis(MdxHierarchySet.all_members(DIMENSION_NAMES[0], DIMENSION_NAMES[0])) \
.add_hierarchy_set_to_column_axis(
MdxHierarchySet.member(Member.of(DIMENSION_NAMES[1], "Calculated Member"))) \
.to_mdx()
csv = self.tm1.cubes.cells.execute_mdx_csv(mdx)
# check header
header = csv.split('\r\n')[0]
self.assertEqual(
",".join(DIMENSION_NAMES[0:2] + ["Value"]),