Comparison of Product Extensions and Data Sources / Datamart

Deciding whether to use Product Extensions (PX) or Data Sources (DS) / Datamarts is sometimes not easy. This table should help you identify the main differences:

Area

Product Extension

Data Source / Datamart

Needed license for

Price Setting module

Analytics module

Designed for big data (e.g. transaction history)

cross mark  No

check mark  Yes

Designed for frequently changing data

check mark  Yes

cross mark  No. The data needs to be loaded from Data Feeds to Data Source and e.g. daily flushed to the Data Source.

Can values be edited by the user

check mark  Yes

cross mark  No

Creating charts

warning Via dashboards using calculation logic

check mark  Directly in the UI and from Datamarts only

Data loading – automatic

  • By IntegrationManager using HTTP transactions (also in batched versions):

    • loaddata/PX

    • integrate/PX

    • delete/PX

    • massupdate/PX

    • add/PX

  • By creating integration in PlatformManager

  • From a CF logic (few records only) using api.addOrUpdate(), api.update(), api.delete()

  • By IntegrationManager using HTTP transactions:

    • loaddata/DMDS

  • From Price Setting as a Data Load using Data Source templates built-in functionality

  • By creating integration in PlatformManager

Data loading – manual

  • Data upload functionality in PlatformManager

  • By uploading an XLS file in the UI

  • Using Excel Client

  • Data upload functionality in PlatformManager

  • By uploading an XLS file in the UI (Data tab)

  • Using Excel Client

Data truncation

  • Manually, by the Mass Delete button

  • By IntegrationManager

  • Manually, by the Truncate button

  • By Truncate Data Load (supports scheduling)

  • By IntegrationManager

Querying from Groovy


api.find("PX", Filter.equal("name", "SalesPrice"), Filter.equal(...))

Note: api.getBatchInfo() should be used in LPGs and price lists to avoid stability issues


def ctx = api.getDatamartContext()
def ds = ctx.getDataSource("SalesDS")
-or-
def ds = ctx.getDataMart("SalesDM")


def query = ctx.newQuery(ds)
.select(..)
...


Note: api.getBatchInfo() should be used in LPGs and price lists to avoid stability issues

Selecting distinct values


api.find("PX", 0, 1, null, ["attribute1"], true, filters)



def query = ctx.newQuery(dm)
.selectDistinct()
..


Aggregation: SUM, AVG, MIN, MAX, COUNT


api.find("PX", 0, 1, null, ["attribute1": "SUM"], true, filters)


api.count(typeCode, filters)



def query = ctx.newQuery(dm, true)
.select("SUM(SalesValue)")


Group by

cross mark  Not available


def query = ctx.newQuery(dm, true)
.select("ProductGroup")
.select("SUM(SalesValue)")


Joins

cross mark  No

Exists

Using Filter.custom

Filter.custom("{clicId} in (SELECTI q.id FROM Quote q)"))


Filter.custom("{id} in (SELECT pricelistId FROM PricelistItem WHERE sku='"+ sku +"')")


Using SQL query

Sorting

check mark  Yes

check mark  Yes

Creating database indexes

warning  Only for customers having dedicated instance; cannot have many of them

Recommendation for the main PX index is (attribute1, attribute2) or potentially (attribute1, attribute2, attribute3).

check mark Created for the key fields and for each dimension