Skip to main content
Question

PQL Query Celonis ML

  • September 9, 2020
  • 1 reply
  • 17 views

Hi Team , Is there any simple way to write a PQL query for select * from table name in celonis ML for get_data_frame(query). As of now we need to add all the column names separately one after the other PQLColumns(). Any suggestions would be helpful. Thank you Amruth

1 reply

Hi Amruth,

 

Yes you can add all columns of a table to a MLW query by looping over the columns of the given table, with a snippet like this:

 

query = pql.PQL()

for col in dm.tables.find('table_name').columns:

query += pql.PQLColumn('\\"table_name\\".\\"'+col['name']+'\\"', col['name'])

 

df = dm.get_data_frame(query)

df.head()

 

And it should of course be possible to adapt this snippet to pull several tables.

 

Best,