Tm1py: Data Spread not working properly

Created on 18 Jun 2020  路  3Comments  路  Source: cubewise-code/tm1py

Hi,

I have observed very weird behavior in TM1py library. When i am trying to spread the value at consolidated level manually at no value or zero cell in tm1 then proportional spread is working fine. But the same when i am trying to achieve using TM1py then it is throwing me DataSpreadFailed exception.

Function used
tm1.cubes.cells.write_values('Cube_name',{("Dimension 1_(Consolidation)","Dimension 2_(Consolidation)"): 'P<>1787'})
Please let me know is there any alternative to achieve this.

Regards,
Pourush Gupta

bug

Most helpful comment

It worked
Thanks @rkvinoth

All 3 comments

Hi Pourush,

Make sure you have the ProportionSpreadToZeroCells parameter in the config file as T
If not, Change that to T and do a restart (read the advantages and disadvantages first).
When you spread on a cell with 0 value, use P1787 rather than P<>1787 (I would use a try block for this kind of situation, feel free to provide any other thoughts).

Sample code:

from TM1py.Services import TM1Service

with TM1Service(address=ADDRESS, port=PORT, ssl=SSL, user=USER, password=PASSWORD) as tm1:

    tm1.cubes.cells.write_values('test', {("Asia", "Q1"): 'P7000'})

Output:

image

@pourushgupta
For future reference, it would be great if you could confirm that the answer provided by @rkvinoth solved your problem.

It worked
Thanks @rkvinoth

Was this page helpful?
0 / 5 - 0 ratings