How to use the mdxpy.MdxHierarchySet function in mdxpy

To help you get started, we’ve selected a few mdxpy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cubewise-code / tm1py / Tests / Cell.py View on Github external
def test_execute_mdx_rows_and_values_string_set_include_empty(self):
        mdx = MdxBuilder.from_cube(STRING_CUBE_NAME) \
            .add_hierarchy_set_to_row_axis(MdxHierarchySet.tm1_subset_all(STRING_DIMENSION_NAMES[0])) \
            .add_hierarchy_set_to_row_axis(MdxHierarchySet.tm1_subset_all(STRING_DIMENSION_NAMES[1])) \
            .add_hierarchy_set_to_column_axis(MdxHierarchySet.tm1_subset_all(STRING_DIMENSION_NAMES[2])) \
            .to_mdx()

        elements_and_string_values = self.tm1.cubes.cells.execute_mdx_rows_and_values_string_set(
            mdx=mdx,
            exclude_empty_cells=False)

        self.assertEqual(
            set(elements_and_string_values),
            {"d1e1", "d1e2", "d1e3", "d1e4", "d2e1", "d2e2", "d2e3", "d2e4", "String1", "String2", "String3", ""})