Page 1 of 1

Filter on attribute and keep the hierarchy

Posted: Wed Dec 22, 2010 1:31 pm
by svgu
We have a product dimension containing products from many countries. We have an attribute on every product that tell us which country the product belong to.
I want to filter out and keep all products from a specific country, and still keep the product hierarchy.

Example:
Product level 1 - Country (null)
Product Car - Country US
Product Ball - Country Sweden

When I use "Filter by attribute", and filter "US", the Product Ball and the Product level 1 disappear. This is not strange because I have no country on Product level 1. But I cant't set the country on the hierarchy levels because I can have products from different countries belonging to the same level in the hierarchy.

Do you know how I can filter on attribute and keep my product hierarchy unchanged?

When I filter US I want the result to be:
Product level 1 - Country (null)
Product Car - Country US


Thanks!

/Sverker

Re: Filter on attribute and keep the hierarchy

Posted: Wed Dec 22, 2010 1:59 pm
by ajain86
filter by attribute looks for the exact value that you entered for the filter. This is why it gets rid of Product level 1.

If a product can only be assigned to 1 country why not create a hierarchy.
Product level1
-> US
--> Car
-> Sweden
--> Ball

If a product can be part of multiple countries, then you can create separate dimension.

Re: Filter on attribute and keep the hierarchy

Posted: Wed Dec 22, 2010 2:02 pm
by tomok
svgu wrote:Do you know how I can filter on attribute and keep my product hierarchy unchanged?
One idea would be to create a separate attribute for each country, i.e. US, CAD, GB, etc., instead of a single "country" attribute, and make the attribute numeric. Then all you have to do is filter on values greater than zero for the country in question as Product level 1 will be >=1 if any of it's children have been flagged for that country. It's a little messy because it requires multiple attributes instead of one but it works and it is easy to understand.

Re: Filter on attribute and keep the hierarchy

Posted: Wed Dec 22, 2010 9:26 pm
by lotsaram
tomok wrote:One idea would be to create a separate attribute for each country, i.e. US, CAD, GB, etc., instead of a single "country" attribute, and make the attribute numeric. Then all you have to do is filter on values greater than zero for the country in question as Product level 1 will be >=1 if any of it's children have been flagged for that country. It's a little messy because it requires multiple attributes instead of one but it works and it is easy to understand.
I'm not sure I follow. Numeric attributes, as discussed often on this forum, are really just "strings disguised as numbers". Numeric attributes don't consolidate, so even if the children of a parent have populated numeric attributes the same attribute for the parent will still be zero unless it has been explicitly populated.

The only way to make this method work would be to hold the numeric 1/0 Boolean country flags in a separate 2D lookup cube and populate the attribute values by a rule referencing the lookup cube.

Re: Filter on attribute and keep the hierarchy

Posted: Wed Dec 22, 2010 10:28 pm
by tomok
lotsaram wrote:The only way to make this method work would be to hold the numeric 1/0 Boolean country flags in a separate 2D lookup cube and populate the attribute values by a rule referencing the lookup cube.
I guess wasn't explicit enough. Yes, I was talking about a user generated attrbute cube. That's just second nature to me because I use this type of cube for attributes more often than the }ElementAttributes kind.