BMC Communities Banner

This Question is Possibly Answered

1 "correct" answer available (10 pts) 2 "helpful" answers available (5 pts)
3 Replies Last post: Nov 13, 2006 8:12 AM by pstupp  
bdholm HotShot 150 posts since
Mar 19, 2002
Currently Being Moderated

Nov 8, 2006 1:42 PM

Multiple reports inside for-each

I am trying to get multiple reports generated inside a single for-each iteration. Specifically, I would like a line graph of total CPU for the busiest business day for a selected server as well as a stacked-bar graph of the top 10 workloads for the same day. I am using the code below:

                         &lt;for-each item=&quot;system-dates&quot; filter-type=&quot;none&quot;&gt;<br/>                              &lt;topbottom-filter type=&quot;points&quot; location=&quot;top&quot; count=&quot;1&quot;&gt;<br/>                                   &lt;!--summarize-series type=&quot;AVERAGE&quot;--&gt;<br/>                                        &lt;date-filter days=&quot;Weekdays&quot; hours=&quot;Business Hours&quot; include=&quot;true&quot;&gt;<br/>                                             &lt;threshold-filter limit=&quot;101&quot; include=&quot;below&quot;&gt;<br/>                                                  &lt;get-data  metric=&quot;/common/CPU/CPU Utilization&quot; /&gt;<br/>                                             &lt;/threshold-filter&gt;<br/>                                        &lt;/date-filter&gt;<br/>                                   &lt;!--/summarize-series--&gt;<br/>                              &lt;/topbottom-filter&gt;<br/><br/>                         &lt;!-- $9 Server Busiest Business Hour Chart showing full day<br/>                         --&gt;<br/>                              &lt;chart title=&quot;Busiest Business Hour for $object0 occurred $start.format&#40;&amp;quot;dd MMM yyyy&amp;quot;&#41;&quot; legend=&quot;bottom&quot;<br/>                                   interval=&quot;data&quot; type=&quot;line&quot; scales=&quot;0-100&quot;  y-labels=&quot;Total System CPU Utilization&quot; x-label=&quot;Hour of Day&quot; &gt;<br/>                                   &lt;threshold-filter include=&quot;above&quot; limit=&quot;0&quot;&gt;<br/>                                        &lt;date-filter days=&quot;Weekdays&quot; hours=&quot;Business Hours&quot; include=&quot;true&quot;&gt;<br/>                                             &lt;threshold-filter limit=&quot;101&quot; include=&quot;below&quot;&gt;<br/>                                                  &lt;get-data  metric=&quot;/common/CPU/CPU Utilization&quot; object=&quot;$iterator&quot; interval=&quot;$iterator&quot;/&gt;<br/>                                             &lt;/threshold-filter&gt;<br/>                                        &lt;/date-filter&gt;<br/>                                   &lt;/threshold-filter&gt;<br/>                              &lt;/chart&gt;<br/><br/>                         &lt;!-- $10 Top 10 Workloads During Busiest Business Hour showing full day<br/>                       --&gt;<br/>                            &lt;chart title=&quot;Top 10 Workload CPU Utilization for $object0&quot; type=&quot;stacked-bar&quot; display-data=&quot;true&quot; interval=&quot;data&quot;&gt;<br/>                                 &lt;date-filter days=&quot;Weekdays&quot; hours=&quot;Business Hours&quot; include=&quot;true&quot;&gt;<br/>                                      &lt;range-filter range=&quot;5-95&quot; type=&quot;percentiles&quot; include=&quot;true&quot;&gt;<br/>                                          &lt;get-data metric=&quot;/common/Workloads/CPU Utilization/Top 10&quot; object=&quot;$iterator&quot; interval=&quot;$iterator&quot;/&gt;<br/>                                     &lt;/range-filter&gt;<br/>                                &lt;/date-filter&gt;<br/>                            &lt;/chart&gt;<br/><br/>                         &lt;/for-each&gt;


However, this is giving me the message "Data Driven statements must have two inputs!". When I include only one of the charts, it works perfectly. What am I missing here?

pstupp Expert 985 posts since
Jan 8, 2002
Currently Being Moderated
1. Nov 8, 2006 9:34 PM in response to: bdholm
RE: Multiple reports inside for-each

Brent,

Data driven inputs must have exactly two input functions, the first specifies the list of items to iterate over and the second is what you want to do with them. In this case you have three inputs, the driver and two charts. To change this into two functions you just need to wrap your two charts into a report function. Essentially;

<br/>&lt;for-each item=&quot;system-dates&quot; filter-type=&quot;none&quot;&gt; <br/>  &lt;topbottom-filter type=&quot;points&quot; location=&quot;top&quot; count=&quot;1&quot;&gt;  <br/>    ...<br/>  &lt;/topbottom-filter&gt; <br/><br/>  &lt;report template=&quot;%0%&amp;lt;br/&gt;&amp;lt;br/&gt;%1%&quot;&gt;<br/>     &lt;!-- Server Busiest Business Hour ... --&gt; <br/>     &lt;chart title=&quot;Busiest Business Hour ...&gt; <br/>       ...<br/>     &lt;/chart&gt;<br/><br/>     &lt;!-- Top 10 Workloads During Busiest ... --&gt;                    <br/>     &lt;chart title=&quot;Top 10 Workload ...&gt;<br/>       ...<br/>     &lt;/chart&gt; <br/>   &lt;/report&gt;<br/>&lt;/for-each&gt;<br/>



Let me know if you have any other questions.
Regards,

Perry.

pstupp Expert 985 posts since
Jan 8, 2002
Currently Being Moderated
3. Nov 13, 2006 8:12 AM in response to: bdholm
RE: Multiple reports inside for-each

Brent,

Report functions can be nested as many times as you want / need, you shouldn't lose anything by doing so. Send me the whole view and I'll take a closer look.

Regards,

Perry.

More Like This

  • Retrieving data ...