Save to server json settings changed

Hi Team,
 
I have customized slice and options object as follows:
 
options = {

“viewType”: “charts”,
“chart”: {
“type”: “line”,
“multipleMeasures”: true,
“position”: “top”,
“showAllLabels”: true,
“showWarning”: true
}
};

slice = {

“rows”: [
{
“uniqueName”: “Date”,

}
],
“measures”: [
{
“uniqueName”: “Minimum Value”,
“aggregation”: “none”,
“active”: true
},
{
“uniqueName”: “Utilization”,
“aggregation”: “none”,
“active”: true
},
{
“uniqueName”: “Maximum Value”,
“aggregation”: “none”,
“active”: true
}
]
}
 
But when I save the json settings on server, some information like aggregation:none is missing from the data I get on server side.
Below is the json I get on server side:
 
“slice”: {
“rows”: [
{
“uniqueName”: “Date”
}
],
“columns”: [
{
“uniqueName”: “[Measures]”
}
],
“measures”: [
{
“uniqueName”: “Minimum Value”
},
{
“uniqueName”: “Utilization”
},
{
“uniqueName”: “Maximum Value”
}
]
},

“options”: {
“viewType”: “charts”,
“chart”: {
“type”: “line”,
“multipleMeasures”: true,
“showAllLabels”: true
}
}
Due to which when I open the report with saved settings, it applies “sum” aggregation which I do not want.
 
Could you please look into the issue ?
 
Thanks
Ganesh

4 answers

Public
Tanya Gryshko Flexmonster July 4, 2018

Hello, Ganesh,
Thank you for writing to us.
"aggregation": "none" is for calculated values only. When you set "aggregation": "none" for a measure which is not calculated, it is not applied inside Flexmonster. Each measure needs to have aggregation applied and if no correct aggregation is specified, "sum" is set by default. The only case when the aggregation is not needed, is flat view.
So, "aggregation": "none" is not saved in the report because this aggregation is not correct for this case. If you do not want "sum" aggregation to be applied you have two options:
1) specify another aggregation
2) specify a flat view type in options
In general, Flexmonster saves to the report only properties that differ from the default ones. For example, you define:

"showAllLabels": true,
"showWarning": true

showAllLabels is false by default, so the value "showAllLabels": true is saved. showWarning is true by default, so when you specify "showWarning": true there is no need to save it within a report.
Please let me know if your issue is solved.
Regards,
Tanya

Public
Ganesh Modak July 9, 2018

Hi Tanya,
 
Thank you for the answer.
 
I am not sure what do you mean by “Calculated Values”, I have set “aggregation”: “none” because it does not make sense to apply aggregations like sum, average etc on our data. Here we want to see utilization, min value and max value against the dates (which is already aggregated on date), so applying aggregations is not an option, similarly, user may save the settings with view type other than flat, so if we force it to flat view, the whole point of saving the settings fails.
 
So, "aggregation": "none" is the correct aggregation in our case and we can’t force the view type to flat, One option I can suggest is if we can save “aggregation”: “none”.
 
Regards
Ganesh

Public
Dmytro Zvazhii Flexmonster July 9, 2018

Hello Ganesh,
Thank you for your feedback. Generally speaking, the idea of the pivot table is to aggregate the raw data and to visualize the results in a comfortable manner. Therefore, the aggregation type is mandatory by design since you cannot display several different values in one cell. The component aggregates them so you can see only one value. 
 
My colleague Tanya has already mentioned that the aggregation type “none” is only applicable for the calculated values. It means that when you define a custom formula in Flexmonster that formula is used to aggregate the raw data instead of simple aggregations such as “sum”, “average” etc… Therefore, the aggregation type for the calculated value is “none” since it is already specified with the custom formula. If you apply “none” aggregation to the simple measure it just will not work. The “none” aggregation will be replaced with the “sum” aggregation.
 
When you need to display already aggregated data in Flexmonster you should not worry about the aggregation. The aggregation type cannot affect already aggregated data. At the same time, you may be interested in hiding the information about the aggregation type in order not to mislead the end user. Therefore, please have a look at the following example:  https://jsfiddle.net/flexmonster/uacsn8q9/15/. We recommend using such properties as 
"showAggregations": false and "showAggregationLabels": false. The "showAggregations" property hides the button for changing aggregations and does not allow to change the aggregation for the measure. The "showAggregationLabels" property hides aggregation labels such as “Sum of …”. In such case, it does not matter what aggregation to apply since the aggregation type does not affect the result value and the information about the aggregation type is not shown on the grid.
 
Please let us know if the suggested approach works fine for you.
Regards,
Dmytro
 

Public
Ganesh Modak July 10, 2018

Hi,
 
The solution worked for me! Thank you
 
Regards
Ganesh

Please login or Register to Submit Answer