Can measures and calculations be grouped?

Answered
Tom Ray asked on December 8, 2020

Can measures and calculations be show under a grouping like dimension group?  Lots of calculations and measures become overwhelming without some sort of organization 

3 answers

Public
Vera Didenko Vera Didenko Flexmonster December 9, 2020

Hello, Tom,
 
Thank you for writing to us. 
 
Yes, measures and calculations can be grouped by specifying the folder property.
 
Here are two ways how grouping can be achieved: 

  1. By specifying the folder property in the /fields response (for custom data source API).
    With this approach, you could also specify nested folders via / (e.g., "Folder/Subfolder").
    Please see the following guide for more details: https://www.flexmonster.com/api/fields-request/
  2. By specifying the folder property in the calculation's definition. 
    We have prepared a JSFiddle example for illustration: https://jsfiddle.net/flexmonster/sqf39xb5/.
    In the example, calculated values are grouped into corresponding folders.
        
     

Please let us know if this helps.
 
Kind regards,
Vera

Public
Tom Ray December 9, 2020

Thanks for the response.  What about grouping measures that are not calculations?  They are used with standard sum for example.  Also along the same lines can non calculated measures be shown together with calculations under the same group?

Public
Vera Didenko Vera Didenko Flexmonster December 11, 2020

Hello, Tom,
 
Thank you for your reply.
 
In case the custom data source API is used, our team recommends specifying the folder property in the /fields response to group non-calculated fields in folders (please see the following guide for more details).
 
Regarding showing non-calculated measures together with calculations under the same group:
We would like to kindly explain that at the moment, calculations are placed in a separate folder by design. 
 

  • For cases when a more custom Field List is needed, we kindly suggest implementing your own Field List and adjusting the behavior in the desired way.

    For adding functionality to your Field List the Flexmonster API calls can be used. 
    The general idea of how a custom Field List can be created is provided in the following thread: https://www.flexmonster.com/question/prevent-to-modify-fields-options/#answer-20339.

  • We would like to mention that although grouping measures together with calculations is not supported, there is a workaround-hack allowing to show measures in a folder together with calculations:

    In the /fields response you can specify the folder in which the field should be shown.
    If the folder name is specified the same as the folder name where Flexmonster places calculations, the corresponding field will be shown together with calculations under the same folder. 
    By default, Flexmonster shows calculations under the "Calculated Values" folder. If desired, the folder name could be changed via localization (please see our localization guide for more details).
    For example, with the configuration in the code snippet below, the folder name for calculations is changed to "All Values":

    new Flexmonster({

    container: "#pivot-container",
    componentFolder: "https://cdn.flexmonster.com/",
    width: "100%",
    height: 550,
    toolbar: true,

    global: {
    localization: {
    fieldsList: {
    formulasGroupName: "All Values"
    }
    }
    },

    report: {...}
    });

    We have prepared a simple JSFiddle for illustration purposes: https://jsfiddle.net/flexmonster/pq64hsw8/.
    In the example, all measures are placed in the same folder as calculations in the Field List.
    The folder name for calculations is changed to "All Values" via localization.
    The "Price" measure and the "Price Average" calculation are shown under the "All Values/Price" subfolder. 

 
Please let us know if this helps. If any questions remain, please feel free to reach out.
Looking forward to your reply.
 
Kind regards,
Vera

Please login or Register to Submit Answer