Report with range

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • item
    Active Community Member
    • Mar 2017
    • 1476

    Report with range

    Hi,
    i have no idea actually, it's possible to make a report with range :
    sample : entity Contact
    field : Age

    so i will something so :

    age from 1 to 6
    age from 7 to 10
    age from 10 to 14

    and then have a Pie chart with theses ranges and % (count) ?

    If you could give the project a star on GitHub. EspoCrm believe our work truly deserves more recognition. Thanks.​
  • yuri
    Member
    • Mar 2014
    • 8453

    #2
    Hi,

    It's possible with a complex expression in Group By.
    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


    • item
      item commented
      Editing a comment
      Thanks Yuri, you are a Genie
  • item
    Active Community Member
    • Mar 2017
    • 1476

    #3
    can i ask a sample print-screen Yuri

    checked but not understand how use complex expression in Group by.

    You can just print-screen what ever field.. i just need a sample complex expression in Group by
    If you could give the project a star on GitHub. EspoCrm believe our work truly deserves more recognition. Thanks.​

    Comment

    • yuri
      Member
      • Mar 2014
      • 8453

      #4
      The Edit button next to Group By input on the Report edit view. Then you can enter an expression. https://docs.espocrm.com/user-guide/...x-expressions/. You can utilize SWITCH function for your case. If you don't have the Age field, but two dates, utilize TIMESTAMPDIFF_YEAR.
      Last edited by yuri; 03-14-2024, 06:33 AM.
      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

      • rabii
        Active Community Member
        • Jun 2016
        • 1250

        #5
        Originally posted by item
        can i ask a sample print-screen Yuri

        checked but not understand how use complex expression in Group by.

        You can just print-screen what ever field.. i just need a sample complex expression in Group by
        Hi mate,

        Here is how you can do it, e.g contact with age. you can add the complex expression below to the Group By

        PHP Code:
        SWITCH:(AND:(GREATER_THAN_OR_EQUAL:(age, 1), LESS_THAN:(age, 10)), 'Children', AND:(GREATER_THAN_OR_EQUAL:(age, 10), LESS_THAN:(age, 20)), 'Adolescents', AND:(GREATER_THAN_OR_EQUAL:(age, 20), LESS_THAN_OR_EQUAL:(age, 30)), 'Young Adults', 'Adults') 
        

        Then choose the pie and in Columns choose COUNT. This will produce a report with pie chart that show contacts in different caregories e.g Children between age 1-10 / Adolescents between 10-20 etc You can change this however you need. Hope this helps. See attached screenshots

        Hope this helps
        Attached Files
        Rabii
        Web Dev

        Comment

        • item
          Active Community Member
          • Mar 2017
          • 1476

          #6
          Waouw..
          Thank you Rabii... yours post is always "valuable"
          I never find how make this complex expression.

          Thanks
          If you could give the project a star on GitHub. EspoCrm believe our work truly deserves more recognition. Thanks.​

          Comment


          • rabii
            rabii commented
            Editing a comment
            you are welcome
        Working...