Hi @sasa.redze12 ,
Although not a direct answer to your question, I have 2 ideas that might help:
- Isn't there a replace function available? You could use this to replace the old query with the new one (assuming you want to replace all occurrences).
- Another option, if you plan to do this regularly, is to use a variable which contains the query that should be executed. If I recall correctly you can set variables in pycelonis, allowing you to easily change the query used. I often use this trick to allow a user to set certain logical elements (e.g. notion of an event or abstraction) through drop-downs.
Hope this helps!
Hi Joos,
thank you for taking the time to answer.
Could you elaborate on your first answer? I haven't found a replace function. Maybe someone else knows more?
Your second suggestion is quite informative but probably not applicable to my use case.
I created a copy of a workspace and used the new notebook to generate a list of potential cases where the CASE WHEN statement needs to be adjusted. I then added a new column where I changed the pql statement. now I would like to loop over that list in pycelonis and replace the old pql statement with the new pql statement..
I got everything running except the part where I can change the pql statement within pycelonis and reupload the analysis.
Hi Joos,
thank you for taking the time to answer.
Could you elaborate on your first answer? I haven't found a replace function. Maybe someone else knows more?
Your second suggestion is quite informative but probably not applicable to my use case.
I created a copy of a workspace and used the new notebook to generate a list of potential cases where the CASE WHEN statement needs to be adjusted. I then added a new column where I changed the pql statement. now I would like to loop over that list in pycelonis and replace the old pql statement with the new pql statement..
I got everything running except the part where I can change the pql statement within pycelonis and reupload the analysis.
Hi @sasa.redze12 ,
I guess this function should do the trick:
pycelonis.celonis_api.process_analytics.analysis — pycelonis 1.5.14 documentation
Let me know if this helps!