Skip to content

content

Module for analysis content.

AnalysisSheet

Bases: PyCelonisBaseModel

Class for analysis sheet containing components such as tables or kpis.

id instance-attribute

id: typing.Optional[str]

Analysis sheet id.

name instance-attribute

name: typing.Optional[str]

Name of analysis sheet.

sheet_filter instance-attribute

sheet_filter: typing.Dict

Sheet filter, filtering data in sheet.

components instance-attribute

components: typing.Optional[
    CelonisCollection[AnalysisComponent]
]

Components (tables, kpis, etc.) of sheet.

get_filter

get_filter()

Returns sheet filter.

Returns:

  • typing.Optional[PQLFilter]

    Sheet filter.

Examples:

Adding sheet filter to custom query and extract data:

sheet = analysis.get_content().draft.document.sheets[0]

query = PQL() + PQLColumn(name="TEST", query="<query")
query += sheet.get_filter()

data_query, query_environment = analysis.resolve_query(query)
df = data_model.export_data_frame(data_query, query_environment)

AnalysisDocument

Bases: PyCelonisBaseModel

Class for analysis document containing sheets.

id instance-attribute

id: typing.Optional[str]

Id of analysis.

name instance-attribute

name: typing.Optional[str]

Name of analysis.

components instance-attribute

components: typing.Optional[
    CelonisCollection[AnalysisSheet]
]

Sheets of analysis.

stateless_load_script instance-attribute

stateless_load_script: typing.Optional[str]

Load script of analysis.

variables instance-attribute

variables: typing.Optional[typing.List]

Variables of analysis.

sheets property

sheets: typing.Optional[CelonisCollection[AnalysisSheet]]

Returns sheets of analysis document.

Returns:

get_filter

get_filter()

Returns load script filter.

Returns:

  • typing.Optional[PQLFilter]

    Load script PQL filter.

Examples:

Adding load script filter to custom query and extract data:

document = analysis.get_content().draft.document

query = PQL() + PQLColumn(name="TEST", query="<query")
query += document.get_filter()

data_query, query_environment = analysis.resolve_query(query)
df = data_model.export_data_frame(data_query, query_environment)

AnalysisDraft

Bases: DraftTransport

Class for analysis draft containing document.

title instance-attribute

title: typing.Optional[str]

Title of analysis draft.

document instance-attribute

document: typing.Optional[AnalysisDocument]

Contains sheets and components of draft.

AnalysisInfo

Bases: AnalysisTransport

Class for basic analysis metadata.

AnalysisContent

Bases: PyCelonisBaseModel

Class for analysis content to read properties from analysis.

analysis instance-attribute

analysis: typing.Optional[AnalysisInfo]

Metadata of analysis.

kpis instance-attribute

kpis: typing.Optional[CelonisCollection[KpiTransport]]

KPIs defined in analysis.

draft instance-attribute

draft: typing.Optional[AnalysisDraft]

Draft of analysis containing sheets and components.

data_model_id instance-attribute

data_model_id: typing.Optional[str]

Id of data model used for analysis.