Alternative approach to correlated sub queries

Alternative approach to correlated sub queries

We are using Zoho Analytics with data from Xero, we wish to show the bank account balances per day, charted over 30 days.

To do this we need the sum of all account transactions to date grouped by account and day. How can I achieve this?
I would normally approach this in SQL with a correlated sub query, something like this:
  1. SELECT 
  2. a."Account ID",
  3.     a."Bank AccountType",
  4.     a."BankAccountNumber",
  5.     a."Name",
  6.     j."Journal Date",
  7.     j."Converted Net Amount",
  8. (SELECT SUM(JournalsInner."Converted Net Amount") FROM "Journals" as JournalsInner WHERE JournalsInner."Account ID" = a."Account ID" AND JournalsInner."Journal Date" <= j."Journal Date") as BalanceToDate 
  9. FROM 
  10. "Accounts" a
  11.     INNER JOIN "Journals" j ON a."Account ID" = j."Account ID"

I understand that correlated sub queries won't work for query tables so how can I achieve this?

Many thanks

Simon




                            Zoho Desk Resources

                            • Desk Community Learning Series


                            • Digest


                            • Functions


                            • Meetups


                            • Kbase


                            • Resources


                            • Glossary


                            • Desk Marketplace


                            • MVP Corner


                            • Word of the Day



                                Zoho Marketing Automation
                                        • Sticky Posts

                                        • We are coming to your city! Zoho Analytics Community Meetup

                                          Hello, business leaders and data enthusiasts! We are delighted to announce that registrations are now open for the ZUG meetups, and we can't wait for you to be a part of them. Our in-house analytics experts are geared up to lead discussions on constructing
                                        • Zoho Analytics: 2021 Look Back

                                          As we start a new year in 2022, here's some of our top moments from 2021. Zoho Analytics in 2021
                                        • [Customer Talk] PREMO Group's Analyst Interview at Zoho Day 2022

                                          Premo Group, a 50 year old Spanish Manufacturing Company, has been our long-standing customer with #ZohoAnalytics. They've been using our platform for their end-to-end, unified business analytics solution.  Hear more from Claudio Cabeza, Director at PREMO
                                        • Announcing Zoho Analytics 5.0 -- A Modern Self-service BI & Analytics Platform

                                          We are extremely delighted to unveil Zoho Analytics 5.0 - A Modern Self-service BI and Analytics platform to the public. Experience analytics like never before with the following new capabilities and enhancements: Comprehensive AI-Powered Data Preparation
                                        • Zoho Analytics | Quarterly Newsletter | Q2 2022

                                          Hello Everyone! I hope all of you are safe and well! Zoho Analytics - Q2 Quarterly Newsletter is out now! Check out the newsletter (attachment) to know all about our new features, recognitions, webinars, blogs, and many more exciting things.  Do let us


                                        Manage your brands on social media



                                              Zoho TeamInbox Resources

                                                Zoho DataPrep Resources



                                                  Zoho CRM Plus Resources

                                                    Zoho Books Resources


                                                      Zoho Subscriptions Resources

                                                        Zoho Projects Resources


                                                          Zoho Sprints Resources


                                                            Qntrl Resources


                                                              Zoho Creator Resources


                                                                Zoho WorkDrive Resources



                                                                  Zoho Campaigns Resources

                                                                    Zoho CRM Resources

                                                                    • CRM Community Learning Series

                                                                      CRM Community Learning Series


                                                                    • Tips

                                                                      Tips

                                                                    • Functions

                                                                      Functions

                                                                    • Meetups

                                                                      Meetups

                                                                    • Kbase

                                                                      Kbase

                                                                    • Resources

                                                                      Resources

                                                                    • Digest

                                                                      Digest

                                                                    • CRM Marketplace

                                                                      CRM Marketplace

                                                                    • MVP Corner

                                                                      MVP Corner

                                                                    





                                                                    




                                                                        Design. Discuss. Deliver.

                                                                        Create visually engaging stories with Zoho Show.

                                                                        Get Started Now