component
Module for analysis components.
AnalysisComponent ¶
Bases: PyCelonisBaseModel
Class for analysis components.
get_filter ¶
Returns filter of component.
Returns:
-
Optional[PQLFilter]
–Component filter.
Examples:
Adding component filter to custom query and extract data:
sheet = analysis.get_content().draft.document.sheets[0]
olap_table = sheet.components.find("#{OLAP Table}", search_attribute="title")
query = PQL() + PQLColumn(name="TEST", query="<query")
query += olap_table.get_filter()
data_query, query_environment = analysis.resolve_query(query)
df = data_model.export_data_frame(data_query, query_environment)
DataComponent ¶
Bases: ABC
, AnalysisComponent
Abstract component class for components displaying data.
get_filter ¶
Returns filter of component.
Returns:
-
Optional[PQLFilter]
–Component filter.
Examples:
Adding component filter to custom query and extract data:
sheet = analysis.get_content().draft.document.sheets[0]
olap_table = sheet.components.find("#{OLAP Table}", search_attribute="title")
query = PQL() + PQLColumn(name="TEST", query="<query")
query += olap_table.get_filter()
data_query, query_environment = analysis.resolve_query(query)
df = data_model.export_data_frame(data_query, query_environment)
get_query ¶
Returns full query with column and filter for component.
Parameters:
-
use_translated_names
(bool
, default:True
) –If true, the translated names will be used as column names. If false, default names will be used.
Returns:
-
PQL
–A PQL query.
Examples:
Adding component query (columns + filters) to custom query and extract data:
sheet = analysis.get_content().draft.document.sheets[0]
olap_table = sheet.components.find("#{OLAP Table}", search_attribute="title")
query = PQL() + PQLColumn(name="TEST", query="<query")
query += olap_table.get_query()
data_query, query_environment = analysis.resolve_query(query)
df = data_model.export_data_frame(data_query, query_environment)
get_columns ¶
Returns all columns of component including dimensions and kpis.
Parameters:
-
use_translated_names
(bool
, default:True
) –If true, the translated names will be used as column names. If false, default names will be used.
Returns:
-
List[PQLColumn]
–List of PQLColumns.
Examples:
Adding component columns to custom query and extract data:
sheet = analysis.get_content().draft.document.sheets[0]
olap_table = sheet.components.find("#{OLAP Table}", search_attribute="title")
query = PQL() + PQLColumn(name="TEST", query="<query")
query += olap_table.get_columns()
data_query, query_environment = analysis.resolve_query(query)
df = data_model.export_data_frame(data_query, query_environment)
SingleKPI ¶
Bases: DataComponent
Class for gauges, numbers, fills, etc.
get_filter ¶
Returns filter of component.
Returns:
-
Optional[PQLFilter]
–Component filter.
Examples:
Adding component filter to custom query and extract data:
sheet = analysis.get_content().draft.document.sheets[0]
olap_table = sheet.components.find("#{OLAP Table}", search_attribute="title")
query = PQL() + PQLColumn(name="TEST", query="<query")
query += olap_table.get_filter()
data_query, query_environment = analysis.resolve_query(query)
df = data_model.export_data_frame(data_query, query_environment)
get_query ¶
Returns full query with column and filter for component.
Parameters:
-
use_translated_names
(bool
, default:True
) –If true, the translated names will be used as column names. If false, default names will be used.
Returns:
-
PQL
–A PQL query.
Examples:
Adding component query (columns + filters) to custom query and extract data:
sheet = analysis.get_content().draft.document.sheets[0]
olap_table = sheet.components.find("#{OLAP Table}", search_attribute="title")
query = PQL() + PQLColumn(name="TEST", query="<query")
query += olap_table.get_query()
data_query, query_environment = analysis.resolve_query(query)
df = data_model.export_data_frame(data_query, query_environment)
get_columns ¶
Returns all columns of component including dimensions and kpis.
Parameters:
-
use_translated_names
(bool
, default:True
) –If true, the translated names will be used as column names. If false, default names will be used.
Returns:
-
List[PQLColumn]
–List of PQLColumns.
Examples:
Adding component columns to custom query and extract data:
sheet = analysis.get_content().draft.document.sheets[0]
olap_table = sheet.components.find("#{OLAP Table}", search_attribute="title")
query = PQL() + PQLColumn(name="TEST", query="<query")
query += olap_table.get_columns()
data_query, query_environment = analysis.resolve_query(query)
df = data_model.export_data_frame(data_query, query_environment)
PQLTable ¶
Bases: DataComponent
Class for OLAP tables, column charts, line charts, etc.
get_filter ¶
Returns filter of component.
Returns:
-
Optional[PQLFilter]
–Component filter.
Examples:
Adding component filter to custom query and extract data:
sheet = analysis.get_content().draft.document.sheets[0]
olap_table = sheet.components.find("#{OLAP Table}", search_attribute="title")
query = PQL() + PQLColumn(name="TEST", query="<query")
query += olap_table.get_filter()
data_query, query_environment = analysis.resolve_query(query)
df = data_model.export_data_frame(data_query, query_environment)
get_columns ¶
Returns all columns of component including dimensions and kpis.
Parameters:
-
use_translated_names
(bool
, default:True
) –If true, the translated names will be used as column names. If false, default names will be used.
Returns:
-
List[PQLColumn]
–List of PQLColumns.
Examples:
Adding component columns to custom query and extract data:
sheet = analysis.get_content().draft.document.sheets[0]
olap_table = sheet.components.find("#{OLAP Table}", search_attribute="title")
query = PQL() + PQLColumn(name="TEST", query="<query")
query += olap_table.get_columns()
data_query, query_environment = analysis.resolve_query(query)
df = data_model.export_data_frame(data_query, query_environment)
get_query ¶
Returns full query with all columns and filter for component.
Parameters:
-
use_translated_names
(bool
, default:True
) –If true, the translated names will be used as column names. If false, default names will be used.
Returns:
-
PQL
–A PQL query.
Examples:
Adding table query to custom query and extract data:
sheet = analysis.get_content().draft.document.sheets[0]
olap_table = sheet.components.find("#{OLAP Table}", search_attribute="title")
query = PQL() + PQLColumn(name="TEST", query="<query")
query += olap_table.get_query()
data_query, query_environment = analysis.resolve_query(query)
df = data_model.export_data_frame(data_query, query_environment)
get_order_by_columns ¶
PivotTable ¶
Bases: DataComponent
Class for Pivot Tables.
get_filter ¶
Returns filter of component.
Returns:
-
Optional[PQLFilter]
–Component filter.
Examples:
Adding component filter to custom query and extract data:
sheet = analysis.get_content().draft.document.sheets[0]
olap_table = sheet.components.find("#{OLAP Table}", search_attribute="title")
query = PQL() + PQLColumn(name="TEST", query="<query")
query += olap_table.get_filter()
data_query, query_environment = analysis.resolve_query(query)
df = data_model.export_data_frame(data_query, query_environment)
get_query ¶
Returns full query with column and filter for component.
Parameters:
-
use_translated_names
(bool
, default:True
) –If true, the translated names will be used as column names. If false, default names will be used.
Returns:
-
PQL
–A PQL query.
Examples:
Adding component query (columns + filters) to custom query and extract data:
sheet = analysis.get_content().draft.document.sheets[0]
olap_table = sheet.components.find("#{OLAP Table}", search_attribute="title")
query = PQL() + PQLColumn(name="TEST", query="<query")
query += olap_table.get_query()
data_query, query_environment = analysis.resolve_query(query)
df = data_model.export_data_frame(data_query, query_environment)
get_columns ¶
Returns all columns of component including dimensions and kpis.
Parameters:
-
use_translated_names
(bool
, default:True
) –If true, the translated names will be used as column names. If false, default names will be used.
Returns:
-
List[PQLColumn]
–List of PQLColumns.
Examples:
Adding component columns to custom query and extract data:
sheet = analysis.get_content().draft.document.sheets[0]
olap_table = sheet.components.find("#{OLAP Table}", search_attribute="title")
query = PQL() + PQLColumn(name="TEST", query="<query")
query += olap_table.get_columns()
data_query, query_environment = analysis.resolve_query(query)
df = data_model.export_data_frame(data_query, query_environment)
Boxplot ¶
Bases: DataComponent
Class for Box Plots.
get_filter ¶
Returns filter of component.
Returns:
-
Optional[PQLFilter]
–Component filter.
Examples:
Adding component filter to custom query and extract data:
sheet = analysis.get_content().draft.document.sheets[0]
olap_table = sheet.components.find("#{OLAP Table}", search_attribute="title")
query = PQL() + PQLColumn(name="TEST", query="<query")
query += olap_table.get_filter()
data_query, query_environment = analysis.resolve_query(query)
df = data_model.export_data_frame(data_query, query_environment)
get_query ¶
Returns full query with column and filter for component.
Parameters:
-
use_translated_names
(bool
, default:True
) –If true, the translated names will be used as column names. If false, default names will be used.
Returns:
-
PQL
–A PQL query.
Examples:
Adding component query (columns + filters) to custom query and extract data:
sheet = analysis.get_content().draft.document.sheets[0]
olap_table = sheet.components.find("#{OLAP Table}", search_attribute="title")
query = PQL() + PQLColumn(name="TEST", query="<query")
query += olap_table.get_query()
data_query, query_environment = analysis.resolve_query(query)
df = data_model.export_data_frame(data_query, query_environment)
get_columns ¶
Returns all columns of component including dimensions and kpis.
Parameters:
-
use_translated_names
(bool
, default:True
) –If true, the translated names will be used as column names. If false, default names will be used.
Returns:
-
List[PQLColumn]
–List of PQLColumns.
Examples:
Adding component columns to custom query and extract data:
sheet = analysis.get_content().draft.document.sheets[0]
olap_table = sheet.components.find("#{OLAP Table}", search_attribute="title")
query = PQL() + PQLColumn(name="TEST", query="<query")
query += olap_table.get_columns()
data_query, query_environment = analysis.resolve_query(query)
df = data_model.export_data_frame(data_query, query_environment)
WorldMap ¶
Bases: DataComponent
Class for World Map Plots.
get_filter ¶
Returns filter of component.
Returns:
-
Optional[PQLFilter]
–Component filter.
Examples:
Adding component filter to custom query and extract data:
sheet = analysis.get_content().draft.document.sheets[0]
olap_table = sheet.components.find("#{OLAP Table}", search_attribute="title")
query = PQL() + PQLColumn(name="TEST", query="<query")
query += olap_table.get_filter()
data_query, query_environment = analysis.resolve_query(query)
df = data_model.export_data_frame(data_query, query_environment)
get_query ¶
Returns full query with column and filter for component.
Parameters:
-
use_translated_names
(bool
, default:True
) –If true, the translated names will be used as column names. If false, default names will be used.
Returns:
-
PQL
–A PQL query.
Examples:
Adding component query (columns + filters) to custom query and extract data:
sheet = analysis.get_content().draft.document.sheets[0]
olap_table = sheet.components.find("#{OLAP Table}", search_attribute="title")
query = PQL() + PQLColumn(name="TEST", query="<query")
query += olap_table.get_query()
data_query, query_environment = analysis.resolve_query(query)
df = data_model.export_data_frame(data_query, query_environment)
get_columns ¶
Returns all columns of component including dimensions and kpis.
Parameters:
-
use_translated_names
(bool
, default:True
) –If true, the translated names will be used as column names. If false, default names will be used.
Returns:
-
List[PQLColumn]
–List of PQLColumns.
Examples:
Adding component columns to custom query and extract data:
sheet = analysis.get_content().draft.document.sheets[0]
olap_table = sheet.components.find("#{OLAP Table}", search_attribute="title")
query = PQL() + PQLColumn(name="TEST", query="<query")
query += olap_table.get_columns()
data_query, query_environment = analysis.resolve_query(query)
df = data_model.export_data_frame(data_query, query_environment)
ComponentFactory ¶
Factory class to create AnalysisComponent with given type.
get_component
staticmethod
¶
Returns instance of AnalysisComponent depending on type.
Parameters:
-
component
(AnalysisComponent
) –AnalysisComponent containing properties of component.
Returns:
-
AnalysisComponent
–A AnalysisComponent object with proper class based on type.
get_components
staticmethod
¶
Returns instances of AnalysisComponent depending on type.
Parameters:
-
components
(List[AnalysisComponent]
) –List of AnalysisComponent containing properties of components.
Returns:
-
CelonisCollection[AnalysisComponent]
–A CelonisCollection of AnalysisComponent objects with proper class based on type.