I'm trying to use Canvas to map values so that different data sources can be filtered on a common, mapped column.
I would have expected that a DropDown Filter with a mapped column would filter the same values on the rest of my elements, but that doesn't seem to be working.
See the attached worksheet for an example of what I mean using the demo data; is it possible to filter on mapped columns like this, or am I expecting too much?
Example
A table using demo data:
filters
| demodata
| mapColumn "cool-project"
fn=${getCell "project" | switch
{case if={compare eq to="kibana"} then="KIB"}
{case if={compare eq to="logstash"} then="LOG"}
{case if={compare eq to="opbeat"} then="OPB"}
{case if={compare eq to="elasticsearch"} then="ELS"}
default="other"
}
| table
| render
A filter which I would expect to filter that table:
demodata
| mapColumn "cool-project"
fn=${getCell "project" | switch
{case if={compare eq to="kibana"} then="KIB"}
{case if={compare eq to="logstash"} then="LOG"}
{case if={compare eq to="opbeat"} then="OPB"}
{case if={compare eq to="elasticsearch"} then="ELS"}
default="other"
}
| dropdownControl valueColumn="cool-project" filterColumn="cool-project"
| render
Full worksheet of example
{
"name": "mapColumn Test",
"id": "workpad-6c44f576-2ce6-49ce-9c0d-59d12fc39b4f",
"width": 1080,
"height": 720,
"page": 0,
"pages": [
{
"id": "page-e45857cf-2426-4cef-b13e-4387a1728c8c",
"style": {
"background": "#fff"
},
"transition": {},
"elements": [
{
"id": "element-842b2f96-0aaa-4e51-a96f-6a7ff2394ac6",
"position": {
"left": 20,
"top": 20,
"width": 500,
"height": 50,
"angle": 0
},
"expression": "demodata\n| mapColumn \"cool-project\"\n fn=${getCell \"project\" | switch \n{case if={compare eq to=\"kibana\"} then=\"KIB\"}\n{case if={compare eq to=\"logstash\"} then=\"LOG\"}\n{case if={compare eq to=\"opbeat\"} then=\"OPB\"}\n{case if={compare eq to=\"elasticsearch\"} then=\"ELS\"}\n default=\"other\"\n }\n| dropdownControl valueColumn=\"cool-project\" filterColumn=\"cool-project\"\n| render",
"filter": ""
},
{
"id": "element-c7bba917-d8c1-40fe-8f10-37ce0a6608e3",
"position": {
"left": 63,
"top": 204,
"width": 971,
"height": 368,
"angle": 0
},
"expression": "filters\n| demodata\n| mapColumn \"cool-project\"\n fn=${getCell \"project\" | switch \n{case if={compare eq to=\"kibana\"} then=\"KIB\"}\n{case if={compare eq to=\"logstash\"} then=\"LOG\"}\n{case if={compare eq to=\"opbeat\"} then=\"OPB\"}\n{case if={compare eq to=\"elasticsearch\"} then=\"ELS\"}\n default=\"other\"\n }\n| table\n| render"
}
]
}
],
"colors": [
"#37988d",
"#c19628",
"#b83c6f",
"#3f9939",
"#1785b0",
"#ca5f35",
"#45bdb0",
"#f2bc33",
"#e74b8b",
"#4fbf48",
"#1ea6dc",
"#fd7643",
"#72cec3",
"#f5cc5d",
"#ec77a8",
"#7acf74",
"#4cbce4",
"#fd986f",
"#a1ded7",
"#f8dd91",
"#f2a4c5",
"#a6dfa2",
"#86d2ed",
"#fdba9f",
"#000000",
"#444444",
"#777777",
"#BBBBBB",
"#FFFFFF",
"rgba(255,255,255,0)"
],
"@timestamp": "2019-02-25T12:09:40.840Z",
"@created": "2019-02-25T12:05:16.417Z",
"assets": {}
}