我在GoodData UI中使用了AttributeFilter,但是显示:
抱歉,我们无法找到这种见解 该URL的见解不存在。
我使用了以下示例:https://sdk.gooddata.com/gooddata-ui/docs/filter_visual_components.html#attributefilter
如何解决?
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>
); }
请求有效载荷 {“ execution”:{“ afm”:{“ attributes”:[{“ displayForm”:{“ uri”:“ / gdc / md / dkrwpz8ki4iplckqups7luwz8uiviacy / obj / 1048”},“ localIdentifier”:“ 2ece68a1703740468b227334a79639b8”}, “ displayForm”:{“ uri”:“ / gdc / md / dkrwpz8ki4iplckqups7luwz8uiviacy / obj / 1082”},“ localIdentifier”:“ 5e544ec629ee499f86bd4cd573cfe3b5”}],“ measures”:[{“ localIdentifier” dc“ dc” 55“ 7” :{“ measure”:{“ item”:{“ uri”:“ / gdc / md / dkrwpz8ki4iplckqups7luwz8uiviacy / obj / 5215”},“ aggregation”:“ sum”}},“ alias”:“ Soma de Vl Faturamento Total “,” format“:”#,## 0.00“},{” localIdentifier“:” d966647e4441403bb2a970db13e97440“,”定义“:{” 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”:“ 5e544ec629ee499 f86bd4cd573cfe3b5“,” direction“:” asc“}}],”维度“:[{” itemIdentifiers“:[” 2ece68a1703740468b227334a79639b8“,” 5e544ec629ee499f86bd4cd573cfe3b5“]]},{”:itemIdentifiers
答案 0 :(得分:0)
我更改了元素ID中的对象,工作成功。
感谢伊万。