Drill hierarchy without effect


#1

I have a drill hierarchy configuration to display some products categories and then the products within those categories like this:

{
   'cat-prod-bars': {
     'group1': ['prodCat', 'prodName']
   }
}

But then when the filter is applied, it doesn’t do anything. I wonder if group1 is correct, or something else goes there? I’ve also verified that cat-prod-bars matches the element for that visualization.

I’ve seen the getId() function used in ChartFactor studio, but I don’t know if it has anything to do with it.


#2

Hi @oliver. Could you post also the code for the Interaction Manager and the one for your visualization? It’s hard to figure out what’s going on only with the configuration. However here a few things that could be the reason:

  1. The filter being applied doesn’t match with any of the fields of the hierarchy
  2. The visualization is not grouped by ‘prodCat’ initially
  3. The drill configuration object may not be set to the interaction manager (.set('drill', drillConf))
  4. There may be a rule for that visual that is stopping it from being filtered (receive: false or clientFilter:true)
  5. The id of the visualization doesn’t match with the DOM element.

From the previous you’ve got the 5 covered, but I included it for a full troubleshooting. What your asking getId() is no required since is only applicable in Studio context.

I hope it helps.


#3

Hi @eduardo, I was so stuck in the issue that I forgot to mention that the drill works only if I apply the filter from the visualization itself!, but not when I apply the same field from others! As you can see I don’t have any rule for the interaction manager.

here is my configuration:

const drill = {
   'cat-prod-bars': {
     'group1': ['prodCat', 'prodName']
   }
}

// Interaction manager
const im = cf.create()
            .graph('Interaction Manager')
            .set('drill', drill)
            .element('int-manager')
            .execute();

// ===== visualization ====
//
const prodcat = cf.Attribute('prodCat').limit(30).sort('desc', cf.Metric())
cf.provider('BigQuery')
    .source('proddata_042019')
    .groupby()
    .metrics(cf.Metric())
    .element('cat-prod-bars')
    .graph('Bars')
    .execute()

#4

Code looks good to me. The other visual that you’re using to apply the filter, is it from the same source or provider? If the answer is no, can you check if you have any metadata defined? If you have any, then check if the field prodCat has a custom label defined.

If the prodCat has a different label in another source, the Interaction Manager will recognize it as a different field.


#5

I just got to review after the weekend. It turns out you were right! It never crossed my mind to check the metadata. It seems that I set a label there at some moment and forgot about it. I removed the label for that field and it did work. Problem solved :+1: