Skip to main content

I am looking for a solution to automate changes to large number of analyses, where I need to occasionally add/delete columns from tables and graphs, when they become obsolete and replace them with new columns from the data model.

Ideally, I would like to know if there is a way to access analysis content (various components) and manipulate them via pycelonis.

The content is so far only accessible via celonis.apps, where it is not possible to change anything.

Is there a possible solution in pycelonis (or something else) right now?

I don’t think you can do that in an analysis, but hoping that you create one table for removing and adding columns theoretically should work in Views and KM.

You can select the entire table in the View through a KM and when the Data model is updated the view table should ideally update as well


Hi @andrej.barto,

In theory you can, but you need some knowledge or JSON. 

As mentioned on the docs (under ‘Analysis’ & ‘Update’), you can use the serialize_content option to retrieve a JSON file of your analysis, adjust it, and push it back:
https://celonis.github.io/pycelonis/2.11.0/reference/pycelonis/ems/studio/content_node/analysis/#pycelonis.ems.studio.content_node.analysis.Analysis.update

For example, to get the KPIs of an analysis, you need this snippet:

analysis = package.get_analysis(ANALYSIS_ID)

 # Read contect from analysis

 content = analysis_obj.serialized_content

json_content = json.loads(content)

# Get KPIs from JSON content

return(json_content('kpis'])

 

I hope this helps! 


Hi, 

thanks for the quick answer. I tested it today and it works just fine.

Best regards,

Andrej


Hi @andrej.barto,

Glad that it worked. Please mark your question as answered to help other community members.

 

Best regards,

Jan-peter


Reply