Need a special offer?Find out if your project fits.
+

Inline Filter Query

Answered
David Chen asked on February 22, 2016

1) Can someone write a jsfiddle for this question. try to add a filter but it should be initially loaded. Please look at below bold text, is my syntax correct?
2) Also, is there a way disable all the aggregated function but just Average, or disable switching aggregated function (sum,count,min,max,etc..)
3) How to initial load the layout Classic Form in below code
4) viewType: 'charts'   -> this initially load the graph, but can initially load line graph 
.....
"Price": null,
"Quantity": 19
}];
var report = {
configuratorActive: false,
data: jsondata,
filter: [ {uniqueName: "City"} ], 
rows: [{uniqueName: "Color"}],
columns: [{uniqueName: "[Measures]"}],
measures: [{uniqueName: "Price"}, {uniqueName: "Quantity"}],
formats: [{name: "", nullValue: "blank"}],
showHeaders: false
};
report.licens.....

6 answers

Public
Iryna Kulchytska Iryna Kulchytska Flexmonster February 22, 2016

Hello David,
 
Here is a jsfiddle that addresses all your questions: https://jsfiddle.net/irynakulchytska/zmqzspng/1/
1) pages: [{uniqueName: "city"}],
2) measures: [{uniqueName: "Price", aggregation: "average", availableAggregations: ["average"], active: false}, {uniqueName: "Quantity", aggregation: "average", availableAggregations: ["average"]}],
3) classicView: true,
4) chartType: "line",
 
More information on report object properties can be found in the documentation in getReport() API call description http://www.flexmonster.com/api/
 
Kind regards,
Iryna

Public
David Chen February 22, 2016

Hi Iryna 
What if I want to initially filter out say City = Toronto?

Public
Iryna Kulchytska Iryna Kulchytska Flexmonster February 22, 2016

David,
 
Here is a jsfiddle that illustrates how to define filter for city to show only Toronto: https://jsfiddle.net/irynakulchytska/zmqzspng/2/

pages: [{ uniqueName: "city", filter: {members: ["city.[Toronto]"]} }],

 
Kind regards,
Iryna
 

Public
David Chen February 22, 2016

Hi Iryna sorry for the trouble, i meant filtering out Toronto?
 
Thanks

Public
Iryna Kulchytska Iryna Kulchytska Flexmonster February 22, 2016

David,
 
You can filter it out by adding negation: true - https://jsfiddle.net/irynakulchytska/zmqzspng/3/, as follows:

pages: [{uniqueName: "city", filter: {members: ["city.[Toronto]"], negation: true}}],

Which means that all the cities except Toronto will be shown. 
 
Kind regards,
Iryna

Public
Tanya Gryshko Tanya Gryshko Flexmonster December 5, 2016

Hello David and all Flexmonster users,
Please note that in version 2.3 the structure of Report Object was changed. Read about the new structure of Report Object in the documentation: http://www.flexmonster.com/api/report-object/
Have a look at the updated sample:
https://jsfiddle.net/flexmonster/rk05mjxu/
Regards,
Tanya

Please login or Register to Submit Answer