[Cubes/CubesViewer] Set filter outside a hierarchy

Skip to first unread message

Steffen Hartmann

Jun 14, 2016, 8:12:49 AM6/14/16
to Cubes

Hey guys,

I would like to set a filter on my aggregation, but the column is not inside a hierarchy.

My Dimension:

This dimension contains one hierarchy (Country->Region->City). The other columns are not part of the hierarchy.

The drilldown in cubesviewer and direcly (get with curl) is working well. But under Filter there are just the elements from
the hierarchy. Therefore I can just filter by elments from the hierarchy. But I would like to drilldown and than set the filter on OperatingSystem. But this isnt possible because it isnt a element of the hierarchy.

Furthermore I'm confused because I'm only enable to filter along the hierarchy:

How can I filter like that:

or that (OperatingSystem isnt part of a hierarchy)

Maybe you can enlighten me and give me some tips?

Thanks a lot!

ps: my model:

        "name": "dim_connection",
        "levels": [
          {"name": "ConCountryLevel", "label": "Connection Country", "label_attribute": "ConCountry", "attributes": ["ConCountry"]},
          {"name": "ConRegionLevel", "label": "Connection Region", "label_attribute": "ConRegion", "attributes": ["ConRegion"]},
          {"name": "ConCityLevel", "label": "Connection City", "label_attribute": "ConCity", "attributes": ["ConCity"]},
            {"name": "CountryRegionCity", "label": "HierCountryRegionCity", "levels": ["ConCountryLevel", "ConRegionLevel", "ConCityLevel"]}

José Juan Montes

Jun 14, 2016, 5:22:48 PM6/14/16
to cubes-...@googlegroups.com

Imho connection shall not be a dimension. I suggest you to model separate dimensions:

- City: dimension with 3 levels.

- Add twp dimensions for the other twp attributes (operating system, device type).

Why can't you filter by city? Because city is the third level of a hierarchy, thus you need to include the other two levels too. Your first query contains the three levels, the second is incorrect. It's up to the client to include the complete hierarchy values.

imagine it was year/month/day, you cannot use suimply "day". Unless you really need to compare days across months and years, in which case you'd create a separate hierarchy for just that. That makes sense for dates, but not for country/city.

Including always the full hierarchy values is only a problem for the client tool. In this case, you can filter Cities in CubesViewer and it will always send the correct cut value.

Best regards,

Jose Juan Montes

You received this message because you are subscribed to the Google Groups "Cubes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cubes-discus...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Steffen Hartmann

Jun 16, 2016, 8:30:01 AM6/16/16
to Cubes

thank you very much for the answer.

Usually it's totally fine to put a hierarchy (country, region, city) and other attributes like operating system in one dimension. I do not really undestand the concept of the framework is using here.

So, if I would like to filter by an attribute which is not a member of a hierarchy I have to put it in an seperate dimension? This would mean that I would have about 200 dimensions. I dont think thats meaningful.
But if I would like to filter (cut) by an attribute which is not a member of an hierarchy it has to be a member of another dimension.

And just theoretically: If I create another hierarchy for the operating system with just one level I would not be able to group by operating system (drilldown=Country (real drilldown) and drilldown=operating system (grouping).

Furthermore if one dimension can just have items which are part of a hierarchy (I would need about 200 of then) in my cubesviewer filter and drilldown dropdown I would have a list of 200 items.

I'm not sure if I understood the concept of cubes right but I never had this problem in another BI tool.

-If there is a hierarchy in a dimension, can't there be attributes which are not part of the hierarchy?
-If I would like to drilldown by one hierarchy, I'm not able to group by an attribute which is part of the same dimension?
-Do I have to create a seperate dimension for all attributes which are not member of a hierarchy?

Thank you very much for your time

José Juan Montes

Jun 19, 2016, 3:03:27 PM6/19/16
to cubes-...@googlegroups.com
My thoughts:

I think Geo and Operating System (for example) are different dimensions and not part of a hierarchy because they are not naturally related to each other, one is not contained by the other, or they do not represent different taxonomies of the same data. In addition, in this case they are semantically different attributes (one is geographic, with map/area/population implications, the other is a standard dimension, which could have its own hierarchies (OS Brand / OS Version)...

In contrast, Continent and Country are indeed hierarchically related, so they are usually part of a grographic hierarchy, Date attributes (Year / Month / Week / Day) are hierarchically related and are derived data of the same real data (a point in time). So is Operating System Brand and Operating System Version, which have relation since one contains the other.

Dimensions can have extra attributes, but Cubes won't allow you to filter using arbitrary attribuites, only defined dimensions (this is because the backends may need to aggregate data in ways that make difficult or impossible to filter facts using dimension attributes that are not declared as dimensions). CubesViewer, however, will show dimension attributes (currently only in the Facts view mode). An attribute is actually useful as a dimension detail: ie stuff like a country coordinates, or the color in which a dimension value should be represented, or the dimension label in different languages, etc.

You could include Operating System and Browser as levels in a "Country" dimension and then set up several hierarchies in order to use Operating System as a separate dimension. This may work, but I think is incorrect for the reasons stated above and you may hit actual issues (ie. if you need to declare "Country" as a geographic dimension, the "Browser" level stops making sense in that composite dimension):

Presentation is a different thing. I normally group related dimensions using label. For instance I use: "Visitor / Country" and "Visitor / Operating System" etc... It's a bit verbose indeed, but what I mean here is that grouping is different than defining dimensions. Don't be afraid of declaring the dimensions you need, that's normal data warehousing.

Regarding this presentation topic: if after that you have too many dimensions and CubesViewer presentation is not adequate, please feel free to open an Issue with screenshots of the problem, share the model you are using and I'll be happy to provide an alternate menu scheme or other suggestion that facilitates using that many dimensions.

I hope this helps.

Jose Juan Montes
Reply all
Reply to author
0 new messages