Get Free Trial

filtring issues

Answered
dror asked on December 2, 2021

how i declare filter on my aggregation to take top 10 sum *** on my json file

1 answer

Public
Nadia Khodakivska Nadia Khodakivska Flexmonster December 3, 2021

Hello, Dror,
 
Thank you for contacting us.
 
You can define the filter in the Slice object of your report. For example, 

"slice": {
        "rows": [
            {
                "uniqueName": "Category",
                "filter": {
                    "measure": {
                        "uniqueName": "Price",
                        "aggregation": "sum"
                    },
                    "query": {
                        "top": 10
                    }
                }
            }
        ]
    },

More information you can find in our documentation: https://www.flexmonster.com/api/filter-object/
Kindly note that the easiest way to set necessary configurations is to edit your report directly from the UI. Then simply save the report using the Save tab on the toolbar. Now you can add this report to your code.
Alternatively, you may use setFilter API call. For example,

flexmonster.setFilter("Category", {
    "measure": {
      "uniqueName": "Price",
       "aggregation": "sum"
    },
     "query": {
       "top": 10
     }
 });

 
Please let us know if it works for you. Feel free to contact us if other questions arise.
 
Kind regards,
Nadia

Please login or Register to Submit Answer