Skip to content

Execute_MDX function when some elements in query might not exist in TM1? Does TM1Py have a DIMIX function? #967

Answered by MariusWirtz
FHoile asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @FHoile,

when you need to read data for a list of elements and you are not sure if they exist in TM1 I think there are two good solutions:

  1. TM1IGNORE_BADTUPLES

In your MDX query, you can use the TM1IGNORE_BADTUPLES keyword on the axis so that TM1 doesn't raise an error when you provide invalid element names.

  1. Determine not existing elements using a set operation

When you do this check you need to make sure to take into account that TM1 is case and space insensitive on element names and that alias values can be used to reference elements.

The code below covers all those edge cases. The set is case and space-insensitive and the get_all_element_identifiers retrieves a set of all ele…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by FHoile
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants