Summary report in Sugar Report Writer

I have been challenged to create a report that will run (with a run-time option to select # of days prior) that will display:

For each Contact 'Assigned to' name, the number of contacts added during the report period and the total number of contacts they have (including the newly-added),

Graphical and / or row & column  will suffice.

Any ideas?

  • I believe that is going to be two reports. Not sure how you can get the total number in the period and the total number overall in the same report. The Number of Days Prior can grouped by date to get a chart.

    I have not tried this, but you should be able to create a calculated field on the User and have it count the number of Contacts related to that User. You could then include that field in the "rows" section of a Summation with Details report. It would be on every row but it would be there.

  • Hi

    I don´t think the report of rows and columns be useful for you.
    That report don´t have a counter what is that you need, the sum ot the number of "assigned to".
    The graph is optional.
    I suggest you create a report of Summation Report with or without details.
    Or the Matrix Report, this report I think is a lot complex but it cans be very useful.
    Regards.

  • As John and Mauricio mentioned, this is not possible using regular reports, but this is a good candidate by Advanced reports. The only downside of using Advanced reports is that there won't be any "Runtime" option, but this can be overcome by adding the most useful information.

    For example, here is a quick report that I created in the last couple of mins:

    This is the query that I used:


    select concat(u.first_name, ' ', u.last_name) User,
    sum(case when c.date_entered > now() - interval 30 day then 1 else 0 end) 'Created in Last 30 days',
    sum(case when c.date_entered > now() - interval 90 day then 1 else 0 end) 'Created in Last 90 days',
    sum(case when c.date_entered > now() - interval 1 year then 1 else 0 end) 'Created in Last 1 year',
    count(*) 'Created All Time'
    from contacts c,
    users u
    where c.created_by = u.id
    and c.deleted = 0
    and u.deleted = 0
    group by c.created_by
    order by 2 desc, 3 desc, 4 desc, 5 desc, 1;

    Follow this documentation to know more on how to create advanced reports with a query: support.sugarcrm.com/.../

    But - this might cause performance issues since this scans through the whole contacts table, so use it judiciously. 

  • I agree with John that this is better with more than one report.

    Further to that, I think placing the reports on a dashboard and encouraging your user to use the "view report" function if they wish to use the runtime filter might be the best way of providing all the key results in one screen.