Closed TM1si closed 6 months ago
Hi @TM1si you don't need to import those names as all of the services (except manager) are exposed through the TM1Service. The same way you get the cube, you would also call this function
# assuming you have a live connection to TM1 named tm1
leafElements = tm1.elements.get_all_leaf_element_identifiers(...)
OK, I removed all the unneeded services, but I still get an error on this line:
leafElements = tm1.elements.get_all_leaf_element_identifiers(dimName, hierarchy_name = '')
ERROR:
Text: '{"error":{"code":"501","message":"Syntax error at or near: ' } , 0 ) }', character position 65"}}' - Status Code: 400 - Reason: 'Bad Request' - Headers: {'Content-Length': '108', 'Connection': 'keep-alive', 'Content-Encoding': 'gzip', 'Cache-Control': 'no-cache', 'Content-Type': 'application/json; charset=utf-8', 'OData-Version': '4.0'}
If I fix the dimension name to "Monat", then I get:
ERROR:
Text: '{"error":{"code":"501","message":"Syntax error at or near: ' } , 0 ) } } ON ROWS, \n { [} ... ', character position 84"}}' - Status Code: 400 - Reason: 'Bad Request' - Headers: {'Content-Length': '131', 'Connection': 'keep-alive', 'Content-Encoding': 'gzip', 'Cache-Control': 'no-cache', 'Content-Type': 'application/json; charset=utf-8', 'OData-Version': '4.0'}
You can’t pass a blank string as a hierarchy, just leave it blank or pass the dimension name twice if you don’t have a hierarchy
From: TM1si @.> Reply-To: cubewise-code/tm1py @.> Date: Wednesday, March 6, 2024 at 9:33 AM To: cubewise-code/tm1py @.> Cc: "Clapp, Ryan" @.>, Comment @.***> Subject: Re: [cubewise-code/tm1py] Call of "get_all_leaf_element_identifiers" (Issue #1067)
OK, I removed all the unneeded services, but I still get an error on this line: leafElements = tm1.elements.get_all_leaf_element_identifiers(dimName, hierarchy_name = '') ERROR: Text: '{"error":{"code":"501","message":"Syntax error at or near: ' } , 0 ) }', character position 65"}}' - Status Code: 400 - Reason: 'Bad Request' - Headers: {'Content-Length': '108', 'Connection': 'keep-alive', 'Content-Encoding': 'gzip', 'Cache-Control': 'no-cache', 'Content-Type': 'application/json; charset=utf-8', 'OData-Version': '4.0'}
If I fix the dimension name to "Monat", then I get: ERROR: Text: '{"error":{"code":"501","message":"Syntax error at or near: ' } , 0 ) } } ON ROWS, \n { [} ... ', character position 84"}}' - Status Code: 400 - Reason: 'Bad Request' - Headers: {'Content-Length': '131', 'Connection': 'keep-alive', 'Content-Encoding': 'gzip', 'Cache-Control': 'no-cache', 'Content-Type': 'application/json; charset=utf-8', 'OData-Version': '4.0'}
— Reply to this email directly, view it on GitHubhttps://github.com/cubewise-code/tm1py/issues/1067#issuecomment-1981004005, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AEK7GZTK5XGHQCNLK7ADTJLYW4SJ7AVCNFSM6AAAAABEHKRTG6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBRGAYDIMBQGU. You are receiving this because you commented.Message ID: @.***>
Hooray! That's it! Thanks a lot.
I try checking valid element names in a cell definition. I found some API-functions in the documentation, but was not able to call it, bc. it is unknown while code is executed. I nearly imported everything I found:
But function "get_all_leaf_element_identifiers" remains still unknown. I also did not get the proper syntax, i think. Actually that's my code for getting all leaf and consolidated elements for later checking against cells:
Any idea or hint for example code?