Unique Accounts

Hello!

Is there a way to build a dashboard/reporting in Sugar to identify the number of accounts we've contacted by phone and/or email for each assigned user? Since the data we need live in two separate modules (Calls and Emails), I wasn't able to figure this out. We essentially want to track who we haven't reached out to yet for the month (or a specified date).

Let me know if you can assist!

Parents Reply Children
  • Hi Francesca, thanks for this!

    We followed this and we were able to get some progress. I have a SQL code for the custom query we built, are you able to assist? We tried this but certain Call Types are still being counted in the report (exclude Text Message and Outbound Attempt).

    SELECT
    accounts.id AS account_id,
    accounts_cstm.practice_ref_c AS Practice_Ref,
    accounts.name AS Account_Name,
    accounts_cstm.success_manager_c AS Success_Manager,
    accounts_cstm.status_c AS Status,
    accounts_cstm.potential_c AS Potential,
    COUNT(DISTINCT calls.id) AS call_count,
    COUNT(DISTINCT emails.id) AS email_count
    FROM accounts
    LEFT JOIN calls ON accounts.id = calls.parent_id AND calls.parent_type = 'Accounts'
    AND calls.deleted = 0 AND calls.date_start BETWEEN '2023-03-01' AND '2023-03-31'
    LEFT JOIN calls_cstm ON calls.id = calls_cstm.id_c AND calls_cstm.call_type_c NOT IN ('Call Attempt', 'Text Message')
    LEFT JOIN emails ON accounts.id = emails.parent_id AND emails.parent_type = 'Accounts'
    AND emails.deleted = 0 AND emails.date_sent BETWEEN '2023-03-01' AND '2023-03-31'
    LEFT JOIN accounts_cstm ON accounts.id = accounts_cstm.id_c
    WHERE accounts.account_type = 'Customer' AND accounts_cstm.status_c != 'Deactivated' AND accounts.deleted = 0
    GROUP BY accounts.id
    ORDER BY Account_Name;