Example of a Pivot Table SQL Template: NetBackup Job Size
The following example illustrates a key SQL Template Designer formatting feature--Pivot Tables.
From the SQL Template Designer tabbed window, select and and also .
Select and click at the bottom of the Query window.
Enter the heading for the drop-down combo box--in this example,
Enter the following comma-separated list of values and then click : , , , , , ,
These will be the options that a user can select when generating a report.
Click on the tab and enter the following query:
SELECT to_char(start_date,'MM/DD/YY') run_date, to_char(${freeCombo1}) unit, trunc(sum(kilobytes/1024/1024)) size_gb FROM apt_v_nbu_job_detail WHERE start_date BETWEEN ${startDate} AND ${endDate} AND client_id in (${hosts}) GROUP BY to_char(start_date,'MM/DD/YY'), ${freeCombo1}Click and then .
In the Formatting window, select and all three fields:
Save the report to a report menu group. Then, click on the saved report to generate it.