Forum Discussion
dataRoles / dataViewMappings fror muliple tables?
- 1 year ago
Hi AdamWhittaker,
Because categories can have other potential properties (like dataReductionAlgorithm), you would add a select property with an array to your existing object and include the data roles there (like you have done for values). The following should work based on your above definition (or get you close to it - it's a valid pattern that I have used in other visuals):
{ "dataViewMappings": [ { "categorical": { "categories": { "select": [ { "for": { "in": "resourceId" } }, { "for": { "in": "resourceName" } }, { "for": { "in": "territory" } }, { "for": { "in": "eventColor" } } ] }, "values": { "select": [ { "bind": { "to": "eventId" } }, { "bind": { "to": "eventName" } }, { "bind": { "to": "manager" } }, { "bind": { "to": "appointmentNumber" } }, { "bind": { "to": "status" } }, { "bind": { "to": "description" } }, { "bind": { "to": "startDate" } }, { "bind": { "to": "endDate" } } ] } } } ] }Good luck!
Daniel
Hi AdamWhittaker,
Because categories can have other potential properties (like dataReductionAlgorithm), you would add a select property with an array to your existing object and include the data roles there (like you have done for values). The following should work based on your above definition (or get you close to it - it's a valid pattern that I have used in other visuals):
{
"dataViewMappings": [
{
"categorical": {
"categories": {
"select": [
{
"for": {
"in": "resourceId"
}
},
{
"for": {
"in": "resourceName"
}
},
{
"for": {
"in": "territory"
}
},
{
"for": {
"in": "eventColor"
}
}
]
},
"values": {
"select": [
{
"bind": {
"to": "eventId"
}
},
{
"bind": {
"to": "eventName"
}
},
{
"bind": {
"to": "manager"
}
},
{
"bind": {
"to": "appointmentNumber"
}
},
{
"bind": {
"to": "status"
}
},
{
"bind": {
"to": "description"
}
},
{
"bind": {
"to": "startDate"
}
},
{
"bind": {
"to": "endDate"
}
}
]
}
}
}
]
}
Good luck!
Daniel