Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Answered

Reports: Get field value from previous row and add it to current row

(0) ShareShare
ReportReport
Posted on by 60

Hello,
I am generating a report in business central using the vendor general ledger entry table.

I am trying to sum the  balance on each line based on the amount of the line plus the line balance previously calculated. I cannot set a previous amount since I have multiple groups with multiple currencies and would like to retrieve the amount of the previous line based on the group.

I have attached an image with the values I am getting without calculations (Black) with the values I would want to its left (red).


Screenshot-2023_2D00_02_2D00_16-095154-edited.jpg

I am still new to business central development.

If i have no way of doing it I think I will have to sort by currency and just do the calculations but i would love to hear your suggestions.

  • Suggested answer
    Saurav.Dhyani Profile Picture
    Saurav.Dhyani 17,965 Super User 2024 Season 2 on at
    RE: Reports: Get field value from previous row and add it to current row

    Here is an example how to achieve running totals in a RDLC Report -

  • Charbel Hleyhel Profile Picture
    Charbel Hleyhel 60 on at
    RE: Reports: Get field value from previous row and add it to current row

    That is an interesting way of doing it and will test it the next time I would need to implement such feature!

    Thank you!

  • Verified answer
    Greg Enns Profile Picture
    Greg Enns 1,102 on at
    RE: Reports: Get field value from previous row and add it to current row

    Thanks for sharing your answer. As an alternate solution, you should also be able to do this in AL using a variable that you include in the dataset.

    See the NetWeight example here: learn.microsoft.com/.../devenv-report-ext-object

  • Verified answer
    Charbel Hleyhel Profile Picture
    Charbel Hleyhel 60 on at
    RE: Reports: Get field value from previous row and add it to current row

    I was able to fix it using the runningValue function in report builder with the scope as the group.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,391 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,445 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans