0

I used AttributeFilter in GoodData UI but show :

SORRY, WE CAN'T FIND THIS INSIGHT The insight with this URL does not exist.

I used this example: https://sdk.gooddata.com/gooddata-ui/docs/filter_visual_components.html#attributefilter

How do it fix ?

   onApply = (filter) => {
    console.log('AttributeFilterExample filter', filter);
    const isPositive = !!filter.in;
    const elementsProp = isPositive ? 'in' : 'notIn';
    const filters = [{
        [isPositive ? 'positiveAttributeFilter' : 'negativeAttributeFilter']: {
            displayForm: {
                uri: filter.id
            },
            [elementsProp]: filter[elementsProp].map(element => (`/gdc/md/dkrwpz8ki4iplckqups7luwz8uiviacy/obj/1082/elements?id=${element}`)) 
        }
    }];
    this.setState({ filters });
}

render() {
const { filters } = this.state;     
return (
  <div className="App">
    <div style={{ height: 400, width: 600 }}>
         <AttributeFilter
             identifier={"label.cliente.cliente.nome"}
             projectId={"dkrwpz8ki4iplckqups7luwz8uiviacy"} 
             fullscreenOnMobile={false}
             onApply={this.onApply}
    />
        <div style={{ height: 400, width: 600 }}>
            <Visualization
                identifier="aauAZOTPefMe"               
                projectId="dkrwpz8ki4iplckqups7luwz8uiviacy"
                filters={filters}
            />
        </div>
    </div>
  </div>
); }

Request Payload {"execution":{"afm":{"attributes":[{"displayForm":{"uri":"/gdc/md/dkrwpz8ki4iplckqups7luwz8uiviacy/obj/1048"},"localIdentifier":"2ece68a1703740468b227334a79639b8"},{"displayForm":{"uri":"/gdc/md/dkrwpz8ki4iplckqups7luwz8uiviacy/obj/1082"},"localIdentifier":"5e544ec629ee499f86bd4cd573cfe3b5"}],"measures":[{"localIdentifier":"c0f04ea170dc44879d645e55db7b3025","definition":{"measure":{"item":{"uri":"/gdc/md/dkrwpz8ki4iplckqups7luwz8uiviacy/obj/5215"},"aggregation":"sum"}},"alias":"Soma de Vl Faturamento Total","format":"#,##0.00"},{"localIdentifier":"d966647e4441403bb2a970db13e97440","definition":{"measure":{"item":{"uri":"/gdc/md/dkrwpz8ki4iplckqups7luwz8uiviacy/obj/22925"}}},"alias":"Peso Bruto [Faturamento]"}],"filters":[{"positiveAttributeFilter":{"displayForm":{"identifier":"label.cliente.cliente.nome"},"in":["/gdc/md/dkrwpz8ki4iplckqups7luwz8uiviacy/obj/1082/elements?id=347900"]}}],"nativeTotals":[]},"resultSpec":{"sorts":[{"attributeSortItem":{"attributeIdentifier":"5e544ec629ee499f86bd4cd573cfe3b5","direction":"asc"}}],"dimensions":[{"itemIdentifiers":["2ece68a1703740468b227334a79639b8","5e544ec629ee499f86bd4cd573cfe3b5"]},{"itemIdentifiers":["measureGroup"]}]}}}

  • 1
    Hi, can you please provide more details? Which version of Gooddata.UI are you using? Do you fill correct projectId and identifier in AttributeFilter component and correct projectId and measures in ColumnChart component? Example from documentation contains just placeholders which need to be replaced by valid values for your project. Thanks for more info – Ivan Nejezchleb Jan 02 '19 at 15:25
  • Hi Ivan, I tried with Visualization. AttributeFilter works just ColumChart ? – Robson Alves Bezerra Jan 03 '19 at 17:59
  • Hi Robson. it should work with Visualization component too. Does your used Visualization component work itself, without passing the filters from AttributeFilter component? – Ivan Nejezchleb Jan 04 '19 at 13:08
  • And please do you use URI or identifier to specify attribute for AttributeFilter? Thank you – Ivan Nejezchleb Jan 04 '19 at 15:26
  • Hi Ivan, I edited with code partial. – Robson Alves Bezerra Jan 07 '19 at 11:30
  • Hi, you are using identifiers so you need to define also filter by it. Try to change: `displayForm: { **uri**: filter.id }` to `displayForm: { **identifier**: filter.id }` – Ivan Nejezchleb Jan 07 '19 at 14:42
  • Hi Ivan, show filter and report but I apply one item and show error report. – Robson Alves Bezerra Jan 09 '19 at 12:12
  • Hi Robson. I expect that after applying filter there is error during execution. Look at executeAfm request from Network panel of debugging tools and paste here body of request where attributes, filters and measures of chart are defined and in response there should be some error message with explanation what is wrong – Ivan Nejezchleb Jan 10 '19 at 07:52
  • I edited with Request Payload – Robson Alves Bezerra Jan 14 '19 at 12:07
  • Hi Robson, thanks for details. – Ivan Nejezchleb Jan 14 '19 at 14:54
  • Hi Robson. URI: `/gdc/md/dkrwpz8ki4iplckqups7luwz8uiviacy/obj/1082` is uri of attribute display form. But when you are creating `in/notIn` field, you need to use attribute uri. To get this, open `https://YOUR_DOMAIN/gdc/md/dkrwpz8ki4iplckqups7luwz8uiviacy/obj/1082` and you will see field `formOf`. Here mentioned URI needs to be used in your code `[elementsProp]: filter[elementsProp].map(element => (`/gdc/md/dkrwpz8ki4iplckqups7luwz8uiviacy/obj/1082/elements?id=${element}`))` – Ivan Nejezchleb Jan 14 '19 at 15:01
  • Hi Ivan is works. Thanks. – Robson Alves Bezerra Jan 15 '19 at 16:52

1 Answers1

0

I changed object in element id, works successful.

Thanks Ivan.