Ransomware attackers specifically target and attempt to destroy backup systems to increase the probability of payment. Hardening your system is critical. Please ensure you have reviewed your platform security using the Security Hardening Checklist
Cohesity

COHESITY Documentation

Explore our documentation to get started, discover products & new features, access troubleshooting guides, register sources, platforms support.

Products
Data Security Alliance
Visit Cohesity.com
Demos
Support
Blogs
Developers
Partner Portals
Cohesity Community
© 2026 Cohesity, Inc. All Rights Reserved.
Terms of Use|
Privacy Policy|
Legal|
  1. Home
  2. IT Analytics Help
  3. Section IV. End user
  4. Work with the SQL template designer
  5. Example of a Pie Chart SQL Template: Overall Job Status Summary

Example of a Pie Chart SQL Template: Overall Job Status Summary

The following example creates a pie chart that represents the various status' for a job - such as, success, warning and failure - as sectors (slices) in a pie chart.

  1. In the SQL Template Designer, in the Template Designer window, choose Date range and Host groups and client scope.

  2. In the Query window, enter the following select statement and click Validate Query:

    WITH t1 AS (
    SELECT
    0 seq, 'Success' status, count(job_id) status_count
    FROM apt_v_job j
    WHERE j.client_id IN (${hosts})
    AND j.start_date BETWEEN  ${startDate} AND ${endDate}
    AND j.summary_status=0
    UNION
    SELECT
    1 seq, 'Partial' status, count(job_id) status_count
    FROM apt_v_job j
    WHERE j.client_id IN (${hosts})
    AND j.start_date BETWEEN  ${startDate} AND ${endDate}
    AND j.summary_status=1
    UNION
    SELECT
    2 seq, 'Failed' status, count(job_id) status_count
    FROM apt_v_job j
    WHERE j.client_id IN (${hosts})
    AND j.start_date BETWEEN  ${startDate} AND ${endDate}
    AND j.summary_status=2
    )
    SELECT status, status_count 
    FROM t1
    ORDER BY seq
    
  3. In the Formatting window, select Pie Chart from the Display report as drop-down list.

  4. For the Caption field, select status from the drop-down list. Color sequence formatter must be selected on the Caption field.

  5. Select all the fields to be displayed. For a pie chart, you need at least one field to be the caption and another field to be the sector.

  6. Assign custom colors for your pie sectors. Specify the order and first few colors for pie chart sectors by choosing the Color Sequence as the Formatter. Enter the color in the associated Pattern field. Choose from Red, Yellow, Green, Blue, Black, White or Grey. For example, you can make a chart which depicts Success as Green, Partial as Yellow, and Failed as Red.

    Color sequence formatter must be selected on the Caption field. The color values are case-insensitive. If a non-supported color is entered, that color will be ignored. If more sections are present in the pie chart than the colors entered, a random color will be assigned to the additional sections.

    For a pie chart, you need at least one field to be the caption and another field to be the sector.

  7. Click Next, enter a report name and click Finish.

  8. When you run this report, the output will look something like the following:

Feedback

Was this page helpful?
Previous

Configure a Pie Chart SQL Template

Next

Configure a Pivot Table SQL Template

Feedback

Was this page helpful?