Complex report filters using formula

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Dmitry
    Member
    • Jul 2017
    • 85

    Complex report filters using formula

    Hello. I need to create a list report, that shows all Accounts that have related Opportunities of a certain type (Sale Type == "Evaluation").

    I tried to use Complex Expression in the Filters, but I don't see opportunities.saleType in the list of possible parameters, and I can't write the formula freely
    (e.g. I can't write string/contains/(opportunity.saleType, "Evaluation") - I only have to select from the lists.

    What am I doing wrong?
    Click image for larger version

Name:	2019-01-06_17-49-31.png
Views:	284
Size:	6.5 KB
ID:	44657
  • yuri
    Member
    • Mar 2014
    • 8440

    #2
    Hi,

    Don't use complex expression here. Add 'Field' filter Opportinities.Sales Type.
    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

    • Dmitry
      Member
      • Jul 2017
      • 85

      #3
      Hi yuri, thank you for the fast reply! I actually need to list Accounts that have more than 3 Opportunities of that type, how can I do that?

      Comment

      • yuri
        Member
        • Mar 2014
        • 8440

        #4
        Using having https://github.com/espocrm/documenta...d#having-group
        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

        • Dmitry
          Member
          • Jul 2017
          • 85

          #5
          I've read the docs before asking. The "having" option allows counting by opportunity.id, not opportunity.saleType. This is what I am asking in the first place.

          Comment

          • Dmitry
            Member
            • Jul 2017
            • 85

            #6
            Finally, I've achieved what I wanted by combining Having (total count of opportunities) and Field (NOT "saleType==1" OR "saleType==2).

            By the way, for some reason, I had to use NOT with "Sale Type Equal". Using "Sale Type Not equal" didn't work.

            Thank you for support!

            Comment

            • yuri
              Member
              • Mar 2014
              • 8440

              #7
              You can just combine the filter from my anwer #2 and having count(opportunity.id) > 2.
              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...