Versions Compared

Key

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

To access the data from PriceAnalyzer, you first need a deployed Datamart. You should also be familiar with the Filter API section.

Table of Contents
maxLevel1

...

Code Block
languagegroovy
def data = result?.getData()
if (data) { 
    for (row = 0; row < data?.getRowCount(); ++row) {
        def sku = data.getValue(row, 0)
        def turnover = data.getValue(row, 1)
        def pricingDate = data.getValue(row, 2)
        // do something with the sku, turnover and pricingDate
    }
}

Another, a more convenient way of processing the Datamart query result is:

Code Block
result?.getData()?.forEach { row ->
  def sku = row.Sku
  def turnover = row.Turnover
  def pricingDate = row.PricingDate
  // do something with the sku, turnover and pricingDate
}

Or just convert the result to a list of hashmaps:

Code Block
result?.getData()?.collect()

...