cubewise-code / tm1py

TM1py is a Python package that wraps the TM1 REST API in a simple to use library.
http://tm1py.readthedocs.io/en/latest/
MIT License
187 stars 107 forks source link

Function power_bi.execute_view returns too many values on zero suppressed string measure with stacked dimensions on rows #997

Closed Cubewise-gtejeda closed 7 months ago

Cubewise-gtejeda commented 10 months ago

When having stacked dimensions on rows on a view and only a string measure as the column, despite zero suppression applied, the function power_bi.execute_view returns nan values, whereas Architect and Arc display the view correctly.

To Reproduce

  1. Create two dimensions with some elements
  2. Create a measures dimension with only one element, which is set to String
  3. Create a three-dimensional cube with the dimensions from the above steps
  4. Open the cube and create a view with the first two dimensions stacked and the measure dimension on the column
  5. Turn off zero suppression (if turned on)
  6. Enter some data into some of the cells
  7. Turn zero suppression on
  8. Save the view
  9. Run the view in TM1py using the power_bi.execute_view function

Expected behavior The dataframe should contain the same data as displayed in Architect or Arc

Current behavior The dataframe contains nan values

Version TM1py 1.11.3 TM1 Server Version: 11.8.01900.10

Screenshots Arc with zero suppression: image

Pandas dataframe: image

Please let me know if you need further details.

Cubewise-gtejeda commented 9 months ago

Further testing shows that setting use_iterative_json to False produces the correct result.

MariusWirtz commented 7 months ago

solved with https://github.com/cubewise-code/tm1py/pull/1008