Get Free Trial

How to setup custom groups like in Excel Pivot tables?

Answered
Ankit Agarwal asked on July 21, 2021

Hello,
Consider the following report that shows us Sales & Revenue numbers for the 50 US states.
Columns

  • State: possible values are the 50 US states
  • Sales: numeric value
  • Revenue: numeric value

Is there a way for us to allow the user to group these 50 states into custom groups like we can in Excel pivot table (see here: https://exceljet.net/pivot-table/pivot-table-group-by-custom)? This will allow different users to create different custom groups based on what the are interested in. For example, someone can create groups by time-zone; someone else could group by regions – north, south, east, west, etc.
 
Thanks
Ankit
 
 

3 answers

Public
Vera Didenko Vera Didenko Flexmonster July 22, 2021

Hello, Ankit,
 
Thank you for your question.
 
In Flexmonster, it is possible to group data by fields. With this in mind, you can add fields to your data with which your users can create custom groups.
For example, you could add a "Time Zone" field and a "Region" field to each data record:

[
{
"State": "Ohio",
"Region": "Great Lakes",
"Time Zone": "EDT",
"Sales": 3040,
"Revenue": 2039
},
{
"State": "Hawaii",
"Region": "Far West",
"Time Zone": "HST",
"Sales": 7008,
"Revenue": 10293
},
...
]

As a result, these fields will be available in Flexmonster’s UI in the Field List, and your users will be able to select any field that they wish to group the states by and therefore create custom groups.
 
We have prepared a JSFiddle for illustration: https://jsfiddle.net/flexmonster/pzenyc8w/.
In the example, states are grouped by region. You can create a different group by opening the Field List and placing a different field on top of "State". For instance, replacing "Region" with "Time Zone".
 
Please let us know if this helps.
 
Kind regards,
Vera

Public
Ankit Agarwal July 22, 2021

Vera – thanks for the prompt response. 
In the suggested solution, the fields (timezone, region, etc) would still have to be configured as part of the report build – the user is only able to select them from the Field list on the fly.
We are looking to be able to create new fields by grouping data from the existing values for a certain field. Is that an option, or an enhancement that is on the roadmap?

Public
Vera Didenko Vera Didenko Flexmonster July 22, 2021

Hello, Ankit,
 
Thank you for your reply.
 
Flexmonster doesn’t provide such a feature at the moment. Currently, the best solution is to create groups by configuring the data slice. Depending on the use case, another solution would be to update the data during runtime and add new fields to group by. You could use the updateData() or connectTo() API calls to update the data in Flexmonster during runtime.
 
We have added your request to our backlog. However, our roadmap is full at the moment; therefore, we are not ready to provide you with estimates. We will keep you posted on any updates on this point.
 
Feel free to reach out in case any other questions arise.
 
Kind regards,
Vera

Please login or Register to Submit Answer