Get Free Trial

getReport does not include folder information in Measure Objects

Answered
Henry asked on July 13, 2021

Hello,

 
We were following the example provided in this post to group measures and non-measures together in a folder and noticed that we could extend the example to group non-measures/Calculated values together as well. For example, underneath the “Calculated values” folder in the fields popup, we were able to add a folder attribute to each measure object that corresponds to a calculation such that the Calculated values folder had subfolders, e.g., Calculated values/Folder A and Calculated values/Folder B.
 
However, when we call the getReport api and observe the measures attribute of the slice object, we noticed that all of our folder customization do not appear in any of the measure objects associated with calculated values. Is this the expected behavior?
 
We have provided a jsFiddle for convenience

  1. The jsFiddle is set up such that all of our measures are grouped underneath the All/Measure folder as defined by the mapping object.
  2. We then predefined a Calculated value measure object named My Calculation with a folder attribute of Test – in doing so, My Calculation appears underneath Calculated values/Test in the fields popup
  3. When clicking on the Log Measures button, we observed that the the measures outputted to the console contains our calculated value measure object, but it does not contain the folder information.
    • As a result, something like flexmonster.setReport(flexmonster.getReport()) would cause our calculated value to appear outside of the Test folder when we reopen the fields popup.

Please let us know if there is something wrong with the jsFiddle or if we can provide any clarifications or additional information!
 
Kind regards,
Henry

1 answer

Public
Mykhailo Halaida Mykhailo Halaida Flexmonster July 14, 2021

Hi Henry,
 
Thank you for posting your question and providing a detailed explanation.
 
Since the workaround my colleague suggested earlier showcases a “hack” solution that is not a part of the component’s functionality by design, it is not expected to work in the first place.
 
Naturally, this also means that we do not guarantee other issues or unexpected behavior won’t emerge on top of this, which seems to be the case in your situation.
 
Please let us know if there is anything else we can help you with.
 
Best regards,
Mykhailo

Please login or Register to Submit Answer