Skip to content

[WIP] Fix Runningvalue error with scope in function#252

Draft
Copilot wants to merge 2 commits intomasterfrom
copilot/fix-runningvalue-error-scope
Draft

[WIP] Fix Runningvalue error with scope in function#252
Copilot wants to merge 2 commits intomasterfrom
copilot/fix-runningvalue-error-scope

Conversation

Copy link
Contributor

Copilot AI commented Oct 19, 2025

Fix for RunningValue function scope parsing issue

  • Understand the issue - RunningValue function with scope parameter fails with "scope must be a constant" error
  • Locate the bug in Parser.cs - scope detection logic incorrectly identifies the aggregate function as the scope for RunningValue
  • Implement fix to handle RunningValue's unique 3-parameter structure (expression, aggregateFunction, scope)
    • Skip first comma when detecting scope for RunningValue (between expression and aggregate function)
    • Skip DataSet scope validation for RunningValue as it typically uses group names, not DataSet names
  • Build and validate the fix - builds successfully
  • Create tests for RunningValue with and without scope parameter
  • Run tests to ensure no regressions - all RunningValue tests pass
  • Verify with example file (DrilldownTest.rdl) - successfully parses without error
  • Run codeql_checker to verify security
  • Document the changes
Original prompt

This section details on the original issue you should resolve

<issue_title>Runningvalue always give error with scope</issue_title>
<issue_description>Hi.

I try to use the Runningvalue function, but always give the same error : failed to parse: Sum function´s scope mut be a constant. I try different scope names , no luck :

=Runningvalue(Fields!debito.Value,Sum,cuenta)
=Runningvalue(Fields!debito.Value,Sum,Details_cuenta)
=Runningvalue(Fields!debito.Value,Sum,"cuenta")
=Runningvalue(Fields!debito.Value,Sum,"Details_cuenta")
=Runningvalue(Fields!debito.Value,Sum)

My group is called cuenta.

I am doing something wrong?

PD : Example provided in the package gives me the same error.
Thanks
</issue_description>

Comments on the Issue (you are @copilot in this section)

Fixes #144


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Co-authored-by: majorsilence <656288+majorsilence@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Runningvalue always give error with scope

2 participants