pentaho - Add percentages to an OLAP cube Mondrian schema -
i calculate percentage of 1 of measures. example: have measure aggregator distinct-count. calculate percentage of measure, based on current information.
for example: gender users-distinct-count percentage male 25 25% (25/100) female 41 41% (41/100) unk 34 34% (34/100) but, if filter out unk, want percentage out of 25+41, i.e. 66 gender users-distinct-count percentage male 25 37.8% (25/66) female 41 %62.2 (41/66)
i want, when viewing data different dimensions, total sum updated accordingly.
i tried this:
<calculatedmember name="user_percentage" caption="users percentage" formula="[measures].user_count/ ([measures].user_count,[dim1].[all dim1],[dim2].[all dim2])" dimension="measures" visible="true"> </calculatedmember>
but, when filtering values on dimensions (like removing "unk", total remains same (over dim).
thanks,
you should @ client level, not schema level.
the schema has no idea you're querying on rows or columns, client does.
some client tools allow create calculated measure % of visible values, has done query.
example:
with set rowset {[gender].[male],[gender].[female]} member [gender].[visible] aggregate( rowset, [measures].[user_count] ) member [measures].[percentage] ( [measures].[user_count], [gender].currentmember ) / ( [measures].[user_count], [gender].[vislble] ) select rowset on rows, { [measures][user_count], [measures].[percentage] } on columns [my cube]
as must reference set selected on rows when defining percentage, cannot define @ schema level.
Comments
Post a Comment