| package ${{BASIC_PROJECT_NAME}}.datamarts { |
| import ${{BASIC_PROJECT_NAME}}.authorizations.* |
| import ${{BASIC_PROJECT_NAME}}.entities.* |
| import ${{BASIC_PROJECT_NAME}}.cubes.* |
| import org.eclipse.osbp.authentication.account.entities.* |
| |
| datamart ProductSales described by "Sales on products" for { |
| role Sales } using |
| cube Sales nonempty values { |
| axis columns { |
| measure StoreSales |
| measure StoreCost |
| } |
| axis rows { |
| hierarchy TheTime level Year filtered detailed |
| } |
| slicer hierarchy Product level ProductSubcategory filtered |
| } |
| datamart Products described by "My products" for { |
| role Sales |
| role Logistics |
| } using |
| entity Product { |
| navigation { |
| many to one join product_class to entity Product_class { |
| properties { |
| property product_subcategory on axis rows |
| } |
| conditions { |
| condition property product_department = selected |
| } |
| } |
| } |
| properties { |
| property brand_name on axis columns |
| property product_name on axis columns |
| // property sku on axis columns |
| property srp on axis columns |
| property gross_weight on axis columns |
| property net_weight on axis columns |
| property recyclable_package on axis columns |
| property low_fat on axis columns |
| property units_per_case on axis columns |
| property cases_per_pallet on axis columns |
| property shelf_width on axis columns |
| property shelf_height on axis columns |
| property shelf_depth on axis columns |
| } |
| } |
| datamart Employees described by "All employees" for { |
| role Sales |
| role Logistics |
| } using |
| entity Employee { |
| properties { |
| property first_name on axis columns |
| property last_name on axis columns |
| property profileimage on axis columns |
| } |
| conditions { |
| condition |
| property gender |
| = |
| filtered |
| condition |
| property management_role |
| = |
| filtered |
| } |
| ordering { |
| order first_name ascending |
| } |
| } |
| /** datamart to show all relevant information about employee salary */ |
| datamart EmployeeSalary for { |
| role Sales |
| role Logistics |
| } using |
| entity Employee { |
| navigation { |
| many to one join position to entity Position { |
| properties { |
| /** which position the employee has */ |
| property position_title on axis columns |
| property max_scale on axis columns |
| property min_scale on axis columns |
| } |
| conditions { |
| condition |
| property pay_type |
| = |
| filtered |
| } |
| } |
| } |
| properties { |
| /** the employees full name */ |
| property full_name on axis columns |
| /** the date the employee was hired */ |
| property hire_date on axis columns |
| /** flag for male/female */ |
| property gender on axis columns |
| /** is the employee married */ |
| property marital_status on axis columns |
| /** the actual salary */ |
| property salary on axis columns |
| /** the education level the employee has reached */ |
| property education_level on axis columns |
| } |
| conditions { |
| condition |
| property education_level |
| = |
| filtered optional |
| } |
| } |
| datamart SalesByDistrict described by "entity based aggregation of store sales and store cost" using |
| entity Region { |
| navigation { |
| one to many join stores to entity Store { |
| navigation { |
| one to many join sales to entity Sales_fact { |
| properties { |
| property store_sales aggregate summation on axis columns |
| property store_cost aggregate summation on axis columns |
| } |
| } |
| } |
| } |
| } |
| properties { |
| property sales_region on axis rows |
| property sales_district on axis rows |
| } |
| conditions { |
| condition |
| property sales_country |
| = |
| selected |
| } |
| } |
| datamart TopProductsByPromotionMediaShare described by "top products by sales over promotion media type" using |
| cube Sales { |
| derive MediaTotal from |
| hierarchy PromotionMedia condensed |
| over |
| measure UnitSales |
| derive MediaPerc from |
| measure UnitSales |
| / |
| derived MediaTotal |
| * |
| 100 |
| axis columns { |
| hierarchy PromotionMedia level MediaType detailed ordered by |
| derived MediaPerc |
| descending |
| derived MediaPerc |
| } |
| axis rows { |
| topcount(15) of |
| hierarchy Product level ProductCategory |
| over |
| measure StoreSales |
| } |
| slicer |
| hierarchy StoreType level StoreType selected |
| slicer |
| hierarchy TheTime level Year selected |
| } |
| datamart SalesByState described by "cube based profit review" using |
| cube Sales nonempty values { |
| derive GrossProfitPerPiece from(measure StoreSales |
| - |
| measure StoreCost) / |
| measure SalesCount |
| axis columns { |
| measure StoreSales scale group1 |
| measure StoreCost scale group1 |
| derived GrossProfitPerPiece scale group2 |
| } |
| axis rows { |
| hierarchy TheTime level Month detailed |
| } |
| } |
| datamart StoreSizes using |
| cube Store { |
| axis columns { |
| measure StoreSqft |
| measure GrocerySqft |
| } |
| axis rows { |
| hierarchy Store level StoreCountry filtered detailed |
| } |
| axis pages { |
| hierarchy StoreType level StoreType detailed |
| } |
| } |
| datamart HRExpenses described by "Average salary by management role" using |
| cube HR { |
| derive AvgSalary from |
| measure OrgSalary |
| / |
| measure NumberOfEmployees |
| axis columns { |
| measure NumberOfEmployees |
| measure OrgSalary |
| derived AvgSalary |
| } |
| axis rows { |
| hierarchy Position level PositionTitle |
| } |
| slicer |
| hierarchy StoreTypeJoinEmployee level StoreType filtered |
| } |
| datamart WarehouseShipping described by "Goods shipped from warehouse" using |
| cube Warehouse { |
| axis columns { |
| measure UnitsShipped |
| } |
| axis rows { |
| hierarchy TheTime level Quarter filtered |
| } |
| slicer |
| hierarchy Warehouse level StateProvince selected |
| } |
| datamart WarehouseFinance described by "Warehouse financial data per product family" using |
| cube Warehouse nonempty values { |
| axis columns { |
| measure StoreInvoice |
| measure WarehouseSales |
| measure WarehouseCost |
| } |
| axis rows { |
| hierarchy Product level ProductCategory filtered |
| } |
| slicer |
| hierarchy TheTime level Quarter filtered |
| } |
| datamart Warehouse described by "Warehouse data per time" using |
| cube Warehouse nonempty values { |
| axis columns { |
| measure StoreInvoice |
| measure WarehouseSales |
| measure WarehouseCost |
| } |
| axis rows { |
| hierarchy TheTime level Year filtered detailed |
| } |
| slicer |
| hierarchy Product level ProductCategory filtered |
| } |
| datamart SalesByYear described by "Sales over time" using |
| cube Sales { |
| derive PrevPeriod from |
| lag(1) of |
| hierarchy TheTime |
| over |
| measure StoreSales |
| derive PrevIncrease from((measure StoreSales |
| - |
| derived PrevPeriod) / |
| measure StoreSales) * |
| 100 |
| axis columns { |
| hierarchy TheTime level Year filtered detailed |
| measure StoreSales |
| derived PrevIncrease |
| } |
| axis rows { |
| hierarchy Store level StoreState filtered detailed |
| } |
| } |
| datamart PositionUsers described by "Users assigned to a position" using |
| entity Position { |
| navigation { |
| one to many join employees to entity Employee { |
| navigation { |
| many to one join store to |
| entity Store { |
| properties { |
| property store_name on axis rows |
| } |
| conditions { |
| condition |
| property store_name |
| = |
| filtered optional |
| } |
| } |
| } |
| properties { |
| property full_name on axis rows |
| property birth_date on axis columns |
| property education_level on axis columns |
| property gender on axis columns |
| property marital_status on axis columns |
| } |
| } |
| } |
| properties { |
| property position_title on axis columns |
| } |
| conditions { |
| condition |
| property position_title |
| = |
| filtered optional |
| } |
| } |
| datamart PositionStat described by "Position Statistics" using |
| cube HR nonempty values { |
| axis columns { |
| measure OrgSalary |
| } |
| axis rows { |
| hierarchy TimeTheDate level Year |
| } |
| slicer |
| hierarchy Position level PositionTitle filtered |
| } |
| datamart TreemapSales described by "Sales per product" using |
| cube Sales nonempty values { |
| axis columns { |
| measure StoreSales |
| measure SalesCount |
| } |
| axis rows { |
| hierarchy Product level ProductCategory |
| } |
| } |
| datamart TreemapProducts described by "Product hierarchy" using |
| cube Sales nonempty values { |
| axis columns { |
| measure SalesCount |
| } |
| axis rows { |
| hierarchy Product level ProductName |
| } |
| } |
| datamart TaskInfo described by "user tasks" using |
| task PotentialOwner columns { |
| column TaskId |
| column ProcessId |
| column Priority |
| column ActualOwner |
| column Name |
| column Subject |
| column Status |
| column CreatedOn |
| } |
| datamart TaskDetails described by "Task details" using |
| task PotentialOwner columns { |
| column TaskId |
| column Description |
| } |
| conditions { |
| condition |
| column TaskId |
| = |
| filtered |
| } |
| datamart SupplierData described by "Supplier master data" for { |
| role Sales |
| } using |
| entity Supplier tracking { |
| properties { |
| property company on axis columns |
| property headquarter_city on axis columns |
| property headquarter_zipcode on axis columns |
| property gln on axis columns |
| property lastOrder on axis columns |
| property locked on axis columns |
| property phone on axis columns |
| property priority on axis columns |
| property yearlyTurnover on axis columns |
| property headquarter_housenumber on axis columns |
| property headquarter_streetname on axis columns |
| property firstContract on axis columns |
| property rating on axis columns |
| } |
| } |
| datamart UserAccount using |
| entity UserAccount { |
| properties { |
| property email on axis columns |
| property position on axis columns |
| property userName on axis columns |
| property profileimage on axis columns |
| } |
| } |
| datamart EDIOrders using |
| entity EDIOrders { |
| properties { |
| property id on axis rows |
| property importDate on axis columns |
| property latest on axis columns |
| } |
| } |
| datamart EDIOrderHeader using |
| entity EDIOrderHeader { |
| properties { |
| property id on axis rows |
| property orderId on axis columns |
| property hdrDate on axis columns |
| property netAmount on axis columns |
| property totalAmount on axis columns |
| property statusCode on axis columns |
| property taxAmount on axis columns |
| } |
| } |
| datamart EDIOrderCustomer using |
| entity EDIOrderCustomer { |
| properties { |
| property id on axis rows |
| property userName on axis columns |
| property firstName on axis columns |
| property lastName on axis columns |
| property country on axis columns |
| } |
| } |
| datamart EDIOrderItem using |
| entity EDIOrderItem { |
| properties { |
| property id on axis rows |
| property position on axis columns |
| property title on axis columns |
| property price on axis columns |
| property quantity on axis columns |
| property sku on axis columns |
| } |
| } |
| datamart Currencies for { |
| role Sales |
| } using entity Currency { |
| navigation { |
| many to one join currency_day to entity CurrencyDay { |
| properties { |
| property ratingDate on axis columns |
| } |
| conditions { |
| condition property ratingDate = filtered |
| } |
| } |
| many to one join currency_name to entity CurrencyNames { |
| properties { |
| property countries on axis columns |
| property isoCode on axis columns |
| property name on axis columns |
| } |
| } |
| } |
| properties { |
| property conversion_ratio on axis columns |
| } |
| } |
| datamart Product_class for { |
| role Sales |
| } using |
| entity Product_class { |
| properties { |
| property product_subcategory on axis columns |
| property product_category on axis columns |
| property product_department on axis columns |
| property product_family on axis columns |
| } |
| } |
| } |