Monday, March 19, 2012

Keyword "Nothing" as the scope.....

I've been trying to figure out the usage of "Nothing" as the scope parameter, and the more I try, the more I can confused.

It says on the RDL spec:

"For expressions inside data regions:

.......

Specifying the keyword Nothing as the scope is equivalent to specifying the

outermost data region containing the report item in which the aggregate is used."

It seems that what's it saying is that if I have an expression in a table as

= last(somefield, "the name of the table")

is the same as

= last(somefield,Nothing)

But, apparently it;s not. (I tried last, first,sum, count,CountRows, min, max...........)

it doesn't matter where I put "=last(somefield,Nothing)" in the table (i tried table header,footer, detail, and table group header, footer), none of them worked.

and I tried it everywhere in matrix, in charts.

It's just not working.

It always complains about the invalid scope not being the containing data region, containing grouping or dataset name.

However, the only way I get the "Nothing" as the scope to work is in a RunningValue function, not in any other

aggregate funcitons.

Anyone help me with this, please... I need a complete definition on the usage of Nothing as scope.

A scope of Nothing can be used in the following aggregate functions only:
* RunningValue (A scope value of Nothing indicates the running value never resets.)
* RowNumber (A scope value of Nothing indicates detail rows should be counted.)

-- Robert

|||

oh man,,Does it say anywhere on the spec that Nothing can only be used in runningValue and RowNumber?

but thanks very much for the reply.

|||

One more question.

It seems it's very inconsistent in a way that,, I can use nothing as the scope with rowNumber anywhere in a table, including

as table group expression, and table group head and footer, but I can't do it in charts series .

So,,are there any general rule for the places where I can use it?

|||

The Nothing scope can only be used in list or table.

In case of a matrix cells or a chart datapoints, there are two dynamic axis (row groups, column groups). Given that, the direction of the RunningValue (horizontal or vertical) is ambigious and you must specify a row or column group as reset scope to determine the direction of the RunningValue.

Specifically for charts, you may want to take a look at the following whitepaper: http://msdn2.microsoft.com/en-us/library/aa964128.aspx

The relevant section is in the Pareto chart sample. Take a look at step 3 of how to build the pareto chart. It explains RunningValues in charts in more detail.

-- Robert

|||

Thanks very much.

|||

I found one more problem.

In the spec, it says the scope for RowNumber and RunningValue is defaulted to "Nothing" and optional,

(page 100, second edition)

but when I put RowNumber() in any table cell and preview, the viewer will always complain about the missing scope parameter.

Is this a bug in the viewer?

|||

The scope parameter on the RowNumber function is mandatory, so you have to specify: RowNumber(Nothing)

-- Robert

|||

So, it's a mistake in the spec...

Thanks.

No comments:

Post a Comment