Check Tabular Model Status #1368
Answered
by
otykier
muhssamy
asked this question in
🙋♀️TE3 Q&A
-
is there any C# script or any way to identify if the data model status is invalid? i need it as a Boolean either valid or not. |
Beta Was this translation helpful? Give feedback.
Answered by
otykier
Sep 2, 2024
Replies: 1 comment 1 reply
-
Could you clarify what you mean by "data model status is invalid"? Many objects in the model have a var relationshipsReady = Model.Relationships.All(r => r.State == ObjectState.Ready);
var partitionsReady = Model.AllPartitions.All(r => r.State == ObjectState.Ready);
var measuresReady = Model.AllMeasures.All(r => r.State == ObjectState.Ready);
var columnsReady = Model.AllColumns.All(r => r.State == ObjectState.Ready);
var hierarchiesReady = Model.AllHierarchies.All(r => r.State == ObjectState.Ready);
var calculationItemsReady = Model.AllCalculationItems.All(r => r.State == ObjectState.Ready);
var modelReady = relationshipsReady && partitionsReady && measuresReady && columnsReady && hierarchiesReady && calculationItemsReady;
if(modelReady) Info("All objects are ready!");
else Info("Some objects are NOT ready!"); However, a model can be queried even if some objects are not ready - that all depends on the query. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
muhssamy
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Could you clarify what you mean by "data model status is invalid"?
Many objects in the model have a
State
property. It is simple to check if those objects are all in theReady
state: