Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In addition to Groovy Console (in the logic editor) there is also the PA SQL Console (in IDEA Tools). This console was originally developed to simplify development of PriceAnalyzer Analytics queries using SQL, but it can be used for all purposes except for input related functions (for those the console in logic.json is designed).

You can check here that a piece of your logic will work, that a data type is correct, what the result data type of a variable will be etc. And, of course, you can run PA queries here.

  1. Go to IDEA Tools and select PA SQL Console.
  2. Select the Datamart / Data Feed / Data Source to query.
  3. Choose the mode using the 'Use SQL' button button. This example shows the SQL mode.
  4. Click the "table" icon next to it and select columns to use.
    (warning) Select only those columns you really want to work with. The larger number, the bigger performance impact.
  5. In the upper pane of the window enter your SQL query.
  6. Click the 'Generate Groovy SQL element' button button. It executes a template and pre-generates a code in the bottom pane.
  7. Customize this code for your use case. 
    There is a placeholder "__SQL__" which is then at runtime replaced by the content in the upper pane.
    The last line toResultMatrix is there just to display the result, you can remove it.
  8. Run the query by clicking the icon at top right (or pressing Ctrl+Enter).
  9. You can then copy the lines from the bottom pane into your logic to create a real element. You need to replace the "__SQL__" with the content of the upper pane (SQL).

...