Forum Discussion
ysapiyev
8 years agoResponsive Resident
How data reduction algorithm works?
hi everyone, I have a problem with data reduction algorithm. As I understood from the tutorials, data algorithm works to limit data selection. Here is my code in capabilities "values": {
"...
ysapiyev
8 years agoResponsive Resident
I used same data reduction function for categories, with bottom and count equal to 1. However, I still get full amount of data.
v-viig
8 years agoCommunity Champion
Please share the whole capabilities.json
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals
- ysapiyev8 years agoResponsive Resident
{ "dataRoles": [ { "displayName": "Item name", "name": "category", "kind": "Grouping" }, { "displayName": "Dates", "name": "date", "kind": "Grouping" }, { "displayName": "value1", "name": "value1", "kind": "Measure" }, { "displayName": "value1 unit", "name": "value1_unit", "kind": "Measure" }, { "displayName": "value2", "name": "value2", "kind": "Measure" }, { "displayName": "value2 unit", "name": "value2_unit", "kind": "Measure" }, { "displayName": "value3", "name": "value3", "kind": "Measure" }, { "displayName": "value3 unit", "name": "value3_unit", "kind": "Measure" }, { "displayName": "value4", "name": "value4", "kind": "Measure" }, { "displayName": "value4 unit", "name": "value4_unit", "kind": "Measure" } ], "objects": { "myCustomObj": { "displayName": "Chart settings", "properties": { "threshold_color_1": { "displayName": "threshold_color_1", "type": { "fill": { "solid": { "color": true } } } } , "threshold_color_2": { "displayName": "threshold_color_2", "type": { "fill": { "solid": { "color": true } } } },"threshold_color_3": { "displayName": "threshold_color_3", "type": { "fill": { "solid": { "color": true } } } }, "threshold_color_4": { "displayName": "threshold_color_4", "type": { "fill": { "solid": { "color": true } } } }, "fontSize": { "displayName": "Text Size", "type": { "formatting": { "fontSize": true } } }, "fontSize_sec": { "displayName": "Text Size for sec", "type": { "formatting": { "fontSize": true } } }, "fontFamily": { "displayName": "Font family", "type": { "enumeration": [ {"value": "Arial", "displayName": "Arial"}, {"value": "Arial Black", "displayName": "Arial Black"}, {"value": "Arial Unicode MS", "displayName": "Arial Unicode MS"}, {"value": "Bookman Old Style", "displayName": "Bookman Old Style"}, {"value": "Calibri", "displayName": "Calibri"}, {"value": "Cambria", "displayName": "Cambria"}, {"value": "Candara", "displayName": "Candara"}, {"value": "Castellar", "displayName": "Castellar"}, {"value": "Comic Sans MS", "displayName": "Comic Sans MS"}, {"value": "Consolas", "displayName": "Consolas"}, {"value": "Constantia", "displayName": "Constantia"}, {"value": "Corbel", "displayName": "Corbel"}, {"value": "Courier New", "displayName": "Courier New"}, {"value": "Georgia", "displayName": "Georgia"}, {"value": "Impact", "displayName": "Impact"}, {"value": "Lucida Calligraphy", "displayName": "Lucida Calligraphy"}, {"value": "Lucida Sans Unicode", "displayName": "Lucida Sans Unicode"}, {"value": "Segoe UI", "displayName": "Segoe UI"}, {"value": "Segoe UI Light", "displayName": "Segoe UI Light"}, {"value": "Symbol", "displayName": "Symbol"}, {"value": "Tahoma", "displayName": "Tahoma"}, {"value": "Times New Roman", "displayName": "Times New Roman"}, {"value": "Trebuchet MS", "displayName": "Trebuchet MS"}, {"value": "Verdana", "displayName": "Verdana"} ] } }, "text_color": { "displayName": "text color", "type": { "fill": { "solid": { "color": true } } } }, "threshold_1": { "displayName": "value1 threshold", "type": { "numeric": true } } , "threshold_3": { "displayName": "value3 threshold", "type": { "numeric": true } } , "threshold_2": { "displayName": "value2 threshold", "type": { "numeric": true } } , "threshold_4": { "displayName": "value4 threshold", "type": { "numeric": true } } } }, "dataPoint": { "displayName": "Data colors", "properties": { "defaultColor": { "displayName": "Default color", "type": { "fill": { "solid": { "color": true } } } }, "showAllDataPoints": { "displayName": "Show all", "type": { "bool": true } }, "fill": { "displayName": "Fill", "type": { "fill": { "solid": { "color": true } } } }, "fillRule": { "displayName": "Color saturation", "type": { "fill": {} } }, "fontSize": { "displayName": "Text Size", "type": { "formatting": { "fontSize": true } } } } } }, "dataViewMappings": [ { "categorical": { "categories": { "select": [ { "for": { "in": "category" } }, { "for": { "in": "date" } } ], "dataReductionAlgorithm": { "bottom": { "count": 1 } } }, "values": { "group": { "by": "date", "select": [ { "bind": { "to": "value1" } }, { "bind": { "to": "value1_unit" } }, { "bind": { "to": "value2" } },{ "bind": { "to": "value2_unit" } }, { "bind": { "to": "value3" } },{ "bind": { "to": "value3_unit" } }, { "bind": { "to": "value4" } },{ "bind": { "to": "value4_unit" } } ] , "dataReductionAlgorithm": { "bottom": { "count": 1 } } } } } } ] }- v-viig8 years agoCommunity Champion
It works well to me. DataView contains single data-row for each date.
Can you share DataView object that you get in the update method?
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals