Problem with Grouping and Calculation
I'm fairly new with SSRS, so please bear with me. In my data, I have Locations, Centers at those locations, a PD_Amount, and an RB_Amount. The PD_Amount and RB_Amount will be used in a formula to determine an average (RB_Amount/PD_Amount) over GLPeriods.
The average needs to be calculated per GLPeriod. The corresponding month of a given GL Period will represent the column names in the report. I have provided a sample of my data in html:
<html>
<head>
<title>Untitled</title>
</head>
<body>
<TABLE BORDER=1>
<TR>
<TD><P>CoNo</P></TD>
<TD><P>Location</P></TD>
<TD><P>Code</P></TD>
<TD><P>Center</P></TD>
<TD><P>GLMonth</P></TD>
<TD><P>GLMonthText</P></TD>
<TD><P>GLYear</P></TD>
<TD><P>GLPeriod</P></TD>
<TD><P>PD_Amount</P></TD>
<TD><P>RB_Amount</P></TD>
</TR>
<TR>
<TD><P>01</P></TD>
<TD><P>Alabama</P></TD>
<TD><P>22001</P></TD>
<TD><P>Center 1</P></TD>
<TD><P>1</P></TD>
<TD><P>January</P></TD>
<TD><P>2010</P></TD>
<TD><P>3</P></TD>
<TD><P>483</P></TD>
<TD><P>205872.2</P></TD>
</TR>
<TR>
<TD><P>01</P></TD>
<TD><P>Alabama</P></TD>
<TD><P>22001</P></TD>
<TD><P>Center 1</P></TD>
<TD><P>2</P></TD>
<TD><P>February</P></TD>
<TD><P>2010</P></TD>
<TD><P>4</P></TD>
<TD><P>469</P></TD>
<TD><P>198313.17</P></TD>
</TR>
<TR>
<TD><P>01</P></TD>
<TD><P>Alabama</P></TD>
<TD><P>22001</P></TD>
<TD><P>Center 1</P></TD>
<TD><P>3</P></TD>
<TD><P>March</P></TD>
<TD><P>2010</P></TD>
<TD><P>5</P></TD>
<TD><P>461</P></TD>
<TD><P>187043.64</P></TD>
</TR>
<TR>
<TD><P>01</P></TD>
<TD><P>Alabama</P></TD>
<TD><P>22001</P></TD>
<TD><P>Center 1</P></TD>
<TD><P>4</P></TD>
<TD><P>April</P></TD>
<TD><P>2010</P></TD>
<TD><P>6</P></TD>
<TD><P>358</P></TD>
<TD><P>159685.13</P></TD>
</TR>
<TR>
<TD><P>01</P></TD>
<TD><P>Alabama</P></TD>
<TD><P>22001</P></TD>
<TD><P>Center 1</P></TD>
<TD><P>5</P></TD>
<TD><P>May</P></TD>
<TD><P>2010</P></TD>
<TD><P>7</P></TD>
<TD><P>460</P></TD>
<TD><P>200804.4</P></TD>
</TR>
<TR>
<TD><P>01</P></TD>
<TD><P>Alabama</P></TD>
<TD><P>22001</P></TD>
<TD><P>Center 1</P></TD>
<TD><P>6</P></TD>
<TD><P>June</P></TD>
<TD><P>2010</P></TD>
<TD><P>8</P></TD>
<TD><P>580</P></TD>
<TD><P>241108.75</P></TD>
</TR>
<TR>
<TD><P>01</P></TD>
<TD><P>Alabama</P></TD>
<TD><P>22001</P></TD>
<TD><P>Center 1</P></TD>
<TD><P>7</P></TD>
<TD><P>July</P></TD>
<TD><P>2010</P></TD>
<TD><P>9</P></TD>
<TD><P>625</P></TD>
<TD><P>259000.57</P></TD>
</TR>
<TR>
<TD><P>01</P></TD>
<TD><P>Alabama</P></TD>
<TD><P>22001</P></TD>
<TD><P>Center 1</P></TD>
<TD><P>8</P></TD>
<TD><P>August</P></TD>
<TD><P>2010</P></TD>
<TD><P>10</P></TD>
<TD><P>869</P></TD>
<TD><P>367046.3</P></TD>
</TR>
<TR>
<TD><P>01</P></TD>
<TD><P>Alabama</P></TD>
<TD><P>22001</P></TD>
<TD><P>Center 1</P></TD>
<TD><P>9</P></TD>
<TD><P>September</P></TD>
<TD><P>2010</P></TD>
<TD><P>11</P></TD>
<TD><P>706</P></TD>
<TD><P>293908.12</P></TD>
</TR>
<TR>
<TD><P>01</P></TD>
<TD><P>Alabama</P></TD>
<TD><P>22001</P></TD>
<TD><P>Center 1</P></TD>
<TD><P>10</P></TD>
<TD><P>October</P></TD>
<TD><P>2009</P></TD>
<TD><P>0</P></TD>
<TD><P>153</P></TD>
<TD><P>63868.61</P></TD>
</TR>
<TR>
<TD><P>01</P></TD>
<TD><P>Alabama</P></TD>
<TD><P>22001</P></TD>
<TD><P>Center 1</P></TD>
<TD><P>10</P></TD>
<TD><P>October</P></TD>
<TD><P>2010</P></TD>
<TD><P>12</P></TD>
<TD><P>823</P></TD>
<TD><P>417685.36</P></TD>
</TR>
<TR>
<TD><P>01</P></TD>
<TD><P>Alabama</P></TD>
<TD><P>22001</P></TD>
<TD><P>Center 1</P></TD>
<TD><P>11</P></TD>
<TD><P>November</P></TD>
<TD><P>2009</P></TD>
<TD><P>1</P></TD>
<TD><P>166</P></TD>
<TD><P>66103.03</P></TD>
</TR>
<TR>
<TD><P>01</P></TD>
<TD><P>Alabama</P></TD>
<TD><P>22001</P></TD>
<TD><P>Center 1</P></TD>
<TD><P>12</P></TD>
<TD><P>December</P></TD>
<TD><P>2009</P></TD>
<TD><P>2</P></TD>
<TD><P>257</P></TD>
<TD><P>118454.19</P></TD>
</TR>
<TR>
<TD><P>12</P></TD>
<TD><P>Texas</P></TD>
<TD><P>28012</P></TD>
<TD><P>Center 2</P></TD>
<TD><P>1</P></TD>
<TD><P>January</P></TD>
<TD><P>2010</P></TD>
<TD><P>3</P></TD>
<TD><P>336</P></TD>
<TD><P>133645.54</P></TD>
</TR>
<TR>
<TD><P>12</P></TD>
<TD><P>Texas</P></TD>
<TD><P>28012</P></TD>
<TD><P>Center 2</P></TD>
<TD><P>2</P></TD>
<TD><P>February</P></TD>
<TD><P>2010</P></TD>
<TD><P>4</P></TD>
<TD><P>321</P></TD>
<TD><P>131230.79</P></TD>
</TR>
<TR>
<TD><P>12</P></TD>
<TD><P>Texas</P></TD>
<TD><P>28012</P></TD>
<TD><P>Center 2</P></TD>
<TD><P>3</P></TD>
<TD><P>March</P></TD>
<TD><P>2010</P></TD>
<TD><P>5</P></TD>
<TD><P>442</P></TD>
<TD><P>174235.04</P></TD>
</TR>
<TR>
<TD><P>12</P></TD>
<TD><P>Texas</P></TD>
<TD><P>28012</P></TD>
<TD><P>Center 2</P></TD>
<TD><P>4</P></TD>
<TD><P>April</P></TD>
<TD><P>2010</P></TD>
<TD><P>6</P></TD>
<TD><P>449</P></TD>
<TD><P>190144.84</P></TD>
</TR>
<TR>
<TD><P>12</P></TD>
<TD><P>Texas</P></TD>
<TD><P>28012</P></TD>
<TD><P>Center 2</P></TD>
<TD><P>5</P></TD>
<TD><P>May</P></TD>
<TD><P>2010</P></TD>
<TD><P>7</P></TD>
<TD><P>501</P></TD>
<TD><P>209930.88</P></TD>
</TR>
<TR>
<TD><P>12</P></TD>
<TD><P>Texas</P></TD>
<TD><P>28012</P></TD>
<TD><P>Center 2</P></TD>
<TD><P>6</P></TD>
<TD><P>June</P></TD>
<TD><P>2010</P></TD>
<TD><P>8</P></TD>
<TD><P>629</P></TD>
<TD><P>260198.45</P></TD>
</TR>
<TR>
<TD><P>12</P></TD>
<TD><P>Texas</P></TD>
<TD><P>28012</P></TD>
<TD><P>Center 2</P></TD>
<TD><P>7</P></TD>
<TD><P>July</P></TD>
<TD><P>2010</P></TD>
<TD><P>9</P></TD>
<TD><P>425</P></TD>
<TD><P>155709.21</P></TD>
</TR>
<TR>
<TD><P>12</P></TD>
<TD><P>Texas</P></TD>
<TD><P>28012</P></TD>
<TD><P>Center 2</P></TD>
<TD><P>8</P></TD>
<TD><P>August</P></TD>
<TD><P>2010</P></TD>
<TD><P>10</P></TD>
<TD><P>314</P></TD>
<TD><P>126967.97</P></TD>
</TR>
<TR>
<TD><P>12</P></TD>
<TD><P>Texas</P></TD>
<TD><P>28012</P></TD>
<TD><P>Center 2</P></TD>
<TD><P>9</P></TD>
<TD><P>September</P></TD>
<TD><P>2010</P></TD>
<TD><P>11</P></TD>
<TD><P>223</P></TD>
<TD><P>90038.98</P></TD>
</TR>
<TR>
<TD><P>12</P></TD>
<TD><P>Texas</P></TD>
<TD><P>28012</P></TD>
<TD><P>Center 2</P></TD>
<TD><P>10</P></TD>
<TD><P>October</P></TD>
<TD><P>2009</P></TD>
<TD><P>0</P></TD>
<TD><P>255</P></TD>
<TD><P>109005.54</P></TD>
</TR>
<TR>
<TD><P>12</P></TD>
<TD><P>Texas</P></TD>
<TD><P>28012</P></TD>
<TD><P>Center 2</P></TD>
<TD><P>10</P></TD>
<TD><P>October</P></TD>
<TD><P>2010</P></TD>
<TD><P>12</P></TD>
<TD><P>200</P></TD>
<TD><P>105335.45</P></TD>
</TR>
<TR>
<TD><P>12</P></TD>
<TD><P>Texas</P></TD>
<TD><P>28012</P></TD>
<TD><P>Center 2</P></TD>
<TD><P>11</P></TD>
<TD><P>November</P></TD>
<TD><P>2009</P></TD>
<TD><P>1</P></TD>
<TD><P>208</P></TD>
<TD><P>79749.49</P></TD>
</TR>
<TR>
<TD><P>12</P></TD>
<TD><P>Texas</P></TD>
<TD><P>28012</P></TD>
<TD><P>Center 2</P></TD>
<TD><P>12</P></TD>
<TD><P>December</P></TD>
<TD><P>2009</P></TD>
<TD><P>2</P></TD>
<TD><P>191</P></TD>
<TD><P>74337.18</P></TD>
</TR>
</TABLE>
</body>
</html>
In the report, I need to group by Location and Center. Following that, I need a column for each GLMonthText. GLMonthText is driven by the GLPeriod. First column name: =IIF(Fields!.GLPeriod.value = 0, Fields!GLMonthText.value, " "). Subsequent GLMonthText
columns will be driven by the other GLPeriod values the same way.
The row data for each of those GLMonthText columns requires the following calculation: =IIF(Fields!GLPeriod.Value = 0, Fields!RB_Amount.Value\Fields!PD_Amount.Value, 0). The calculation is also driven by the GLPeriod.
My grouping for Location and Center are correct in the report. The problem that I am having is that the column names are resolving to " ", and the formula results to zero. How do I begin to troubleshoot this?
Thank you for your help.
cdun2
November 5th, 2010 12:01pm
Never mind on this. I needed a dynamic column group, driven by the GLPeriod.
Thanks for your help.
cdun2
Free Windows Admin Tool Kit Click here and download it now
November 5th, 2010 2:53pm