Build a complex report based on opportunities calculated fields

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • olamborelle
    Senior Member
    • May 2018
    • 102

    #1

    Build a complex report based on opportunities calculated fields

    Dear all,
    I have added some fields and some calculated fields to the Opportunity entity: estimated start date, end date of the project if won, total foreseen income, and duration in months (calculated), and foreseen estimated income (calculated, flat value).
    So essentially, I have the left part of the screenshot below.

    I'd like ultimately to build a report that does sum these monthly incoming per month (the yellow/ right side of the screenshot), over all opportunities, taking into account start and end date.

    I understand it is not immediately possible...
    Should I create more fields? Another entity?

    Any suggestion how to do that (in formulas or full development?)

    Any hint welcome!

    Thanks,




    Click image for larger version  Name:	image.png Views:	0 Size:	18.9 KB ID:	122867
  • Serge
    Junior Member
    • Oct 2023
    • 9

    #2
    Looks impossible as the yellow fields are dynamic.
    Think about creating 'opportunity lines' per month in that period and try to create the report from that point of view.

    Comment

    • olamborelle
      Senior Member
      • May 2018
      • 102

      #3
      Originally posted by Serge
      Looks impossible as the yellow fields are dynamic.
      Think about creating 'opportunity lines' per month in that period and try to create the report from that point of view.
      Thank you,
      I have added in the Opportunity entity, a field of type Array.

      In the formula, I am able to do things like
      myArrayField = (value1, value2);
      myArrayField = array\push(myArrayField, value3)

      But it seems it is not possible to do something like:
      myArrayField[1] = newvalue2

      ?

      Because my intention was to try and use such an array with 24 values in it: essentially the yellow cells above for the 24 next months.

      Comment

      • yuri
        EspoCRM product developer
        • Mar 2014
        • 9508

        #4
        Hi,

        Developers can create custom reports by implementing a specific interface. It can be useful if your report is quite complex and not possible to build with the UI. You can check LeadsByLastActivity report which is installed with the advanced pack.

        In the 'report' table, set internal_class_name = Custom:MyReport. It will correspond to a PHP class Espo\Custom\Reports\MyReport. This class should implement Espo\Modules\Advanced\Reports\GridReport interface.
        If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

        Comment

        Working...