How can I read data from an existing data source?


I want to read the FiscalCalendar data source and get the FiscalData for today's date.

I tried using the api.find method but I get an error stating Could not find property 'attribute1' in the class net.pricefx.domain.DMDataSource"def fiscalDate = api.find("DMDS",Filter.equal("uniqueName","FiscalCalendar"),Filter.equal("attribute1","20170714")).


What you're looking for is api.getDatamartContext().

In the Analytics module, conversions of a certain Date into Fiscal Year, Quarter, Month and Week are done via a Data Source called "cal", found in Analytics. This is intended to be used only in Analytics, even though you can read it from within any logic in any module.

This Data Source is not populated by default, you must upload the conversion into it (using an XLS file).

Data Sources are queried using a Datamart query (you need to add due null checks and more):


Found an issue in documentation? Write to us.