Announcement

Collapse
No announcement yet.

Report with range

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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) ?


  • #2
    Hi,

    It's possible with a complex expression in Group By.

    Comment


    • item
      item commented
      Editing a comment
      Thanks Yuri, you are a Genie

  • #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

    Comment


    • #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.

      Comment


      • #5
        Originally posted by item View Post
        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:(age1), LESS_THAN:(age10)), 'Children', AND:(GREATER_THAN_OR_EQUAL:(age10), LESS_THAN:(age20)), 'Adolescents', AND:(GREATER_THAN_OR_EQUAL:(age20), LESS_THAN_OR_EQUAL:(age30)), '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

        Comment


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

          Thanks

          Comment


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