Skip to main content

I have one saved formula that I want to apply to data from different tables. the data within the tables is different but the underlying logic and structure is the same. Therefore I would like to know if and how I can use parameters to replace a part or the complete table name with parameters.

 

I tried already to use a text parameter {p1} with the name STREAM, but received syntax errors.

ExampleExample 2 

Can someone help out on this matter? I couldn't find anything about this in the official documentation.

 

Thanks in advance!

Hi @Franziska Schädel ,

 

In the code you refer to the parameter as {STREAM} but you should refer to it as {p1} (although I find your approach more user friendly).

 

Please let me know if this helps!


Hi @joos.buijs, thanks for your fast reply !!! With the info given by you the code finally compiles. Are you maybe aware if this also works with custom formats? Is it possible to manage custom formats in a centralized manner and hand them over via a variable or a parameter?

 

Thanks again !


Hi @joos.buijs, thanks for your fast reply !!! With the info given by you the code finally compiles. Are you maybe aware if this also works with custom formats? Is it possible to manage custom formats in a centralized manner and hand them over via a variable or a parameter?

 

Thanks again !

Hi @Franziska Schädel ,

 

Glad I could help, it would help others if you could mark my post above as answer.

 

Regarding passing custom formats: I tried this a while ago on the on-premise version (CPM 4.6) and there it did not work. My workaround was to create text. In my scenario I let the user set the date aggregation (year, month, day), and I let the PQL output different texts (e.g. '2021', or '2021-01', or '2021-01-05') depending on the aggregation chosen. Hope this also works in your scenario.


Reply