Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I know this topic was brought up ages ago, but in case somebody has a similar issue (like I did) and runs into this thread, here is how I tackled it. Here is an example of the report grouping and sample results in my report:</p> <p>Group 1<br> &nbsp;&nbsp;&nbsp;Sub 1<br> &nbsp;&nbsp;&nbsp;Sub 2<br> &nbsp;&nbsp;&nbsp;Sub 3<br></p> <p>Group 2<br> &nbsp;&nbsp;&nbsp;Sub 1<br> &nbsp;&nbsp;&nbsp;Sub 2<br> &nbsp;&nbsp;&nbsp;Sub 3<br></p> <p>Notice that 'Sub [1-3]' are the exact same header. When using (Fields!GroupId.Value, CountDistinct, Nothing), the statement determines that there are only 3 unique values, and when it gets to the repeating subgroups (Sub [1-3]), the result of the RunningValue does not increase.</p> <p>You can test this out by putting an extra column in your report and then the expression: (RunningValue(Fields!GroupId.Value, CountDistinct, Nothing). The results would look like this:</p> <p>Group 1<br> &nbsp;&nbsp;&nbsp;Sub 1&nbsp;&nbsp;&nbsp;<b>1</b><br> &nbsp;&nbsp;&nbsp;Sub 2&nbsp;&nbsp;&nbsp;<b>2</b><br> &nbsp;&nbsp;&nbsp;Sub 3&nbsp;&nbsp;&nbsp;<b>3</b><br></p> <p>Group 2<br> &nbsp;&nbsp;&nbsp;Sub 1&nbsp;&nbsp;&nbsp;<b>3</b><br> &nbsp;&nbsp;&nbsp;Sub 2&nbsp;&nbsp;&nbsp;<b>3</b><br> &nbsp;&nbsp;&nbsp;Sub 3&nbsp;&nbsp;&nbsp;<b>3</b><br></p> <p>Because the values start repeating, the 'mod 2' portion of the alternating row logic gets messed up. To work around this I had the RunningValue statement combine the Group header as well as the Sub group:</p> <p>(RunningValue(Fields!GroupId.Value+Fields!SubGroupId.Value, CountDistinct, Nothing)</p> <p>After I did this I got this result:</p> <p>Group 1<br> &nbsp;&nbsp;&nbsp;Sub 1&nbsp;&nbsp;&nbsp;<b>1</b><br> &nbsp;&nbsp;&nbsp;Sub 2&nbsp;&nbsp;&nbsp;<b>2</b><br> &nbsp;&nbsp;&nbsp;Sub 3&nbsp;&nbsp;&nbsp;<b>3</b><br></p> <p>Group 2<br> &nbsp;&nbsp;&nbsp;Sub 1&nbsp;&nbsp;&nbsp;<b>4</b><br> &nbsp;&nbsp;&nbsp;Sub 2&nbsp;&nbsp;&nbsp;<b>5</b><br> &nbsp;&nbsp;&nbsp;Sub 3&nbsp;&nbsp;&nbsp;<b>6</b><br></p> <p>Throw that in to your alternating row expression and it should work!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload