sql - MDX - Sum only selected dimension members? -
i'm quite new mdx , i'm having bit of issue aggregation of 1 of measures.
in dsv have "events" table. track agents run these events, , since multiple agents can involved in running single event, have split out separate table of "agent" bridging table in middle:
i want track called "coverage", number of events held in particular week , each agent ran event. if there 3 events held 1 week, , 1 of these events run 2 agents, coverage of 4.
when go analyse cube, dragging on week commencing , count of events, note isn't right - considers individual events , not number of agents. dragging on agents solves still want see overall figure without having drag on agents.
so created calculated member so:
create member currentcube.[measures].[visit coverage] iif([agents].[agent].currentmember.parent null, sum([agents].[agent].[agent], [measures].[events count]), [measures].[events count]);
so basically, if agents selected (parent null), sum of events count each agent, otherwise give me events each individual agent if i'm analysing agent. works great...and works if want filter 1 particular agent, falls on if try filter more 1 (but less all) agents, giving me null value.
i'm stumped on how solve one, me out?
chris
your table design covers requirement count number of events, avoiding double-counting of agents via many-to-many bridge table between main fact table , agent dimension table. if want have measure not avoid double-counting, fact table should directly link dimension tables.
hence, create view or named query has foreign keys 3 dimension tables, , use base of new measure group in addition existing ones. view or named query built join main fact table , bridge table. add count coverage measure measure group.
Comments
Post a Comment