Skip to main content
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

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\\".\\"'+colo'name']+'\\"', colo'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,


Reply