Multi Level Hierarchical Query

Multi Level Hierarchical Query

Hi guys

I have a situation where i am trying to extract the descendants of a particular entry. 

So long story short, i have the Account table with Agency (A) id = 1, and that has child Agency (B) id = 2. This child agency (B) has a child agency (C) id = 3. This child agency (C) has a child agency (D) id = 4. 

So in essence we have have a pyramid setup where each level has other child agencies underneath. The number of levels differ per the preceding Agency.

My question now is, in Analytics how do i write a heirachical query that takes into account all the levels (or rather extract). 

As it is if i write this query: select * from Account where id = 1, it only brings up the first level (Agency B) but i want to have that query show all the agencies (A, B, C, D)


      Zoho Campaigns Resources


        • Desk Community Learning Series


        • Digest


        • Functions


        • Meetups


        • Kbase


        • Resources


        • Glossary


        • Desk Marketplace


        • MVP Corner


        • Word of the Day


        • Ask the Experts


          • Sticky Posts

          • What's New in Zoho Analytics - May 2026

            Hello Users! We're back with another round of updates for Zoho Analytics. This month's release focuses on giving you greater flexibility in how you visualize, manage, and act on your data. We are introducing richer data visualizations, smarter AI-powered
          • What's New in Zoho Analytics - February 2026

            Hello Users! We're back with another round of updates for Zoho Analytics. This month's release focuses on giving you greater flexibility in how you visualize, manage, and act on your data - with new features like custom visualizations, remote MCP server,
          • What's New in Zoho Analytics - January 2026

            Hello Users! We are starting the year with a strong lineup of updates, marking the beginning of many improvements planned to enhance your analytics experience. Explore the latest improvements built to boost performance, simplify analysis, and help you
          • What's New in Zoho Analytics - November 2025

            We're thrilled to announce a significant update focused on expanding your data connectivity, enhancing visualization capabilities, and delivering a more powerful, intuitive, and performant analytics experience. Here’s a look at what’s new. Explore What's
          • What's New in Zoho Analytics - October 2025

            Hello Users! We're are back with a fresh set of updates and enhancements to make data analysis faster and more insightful. Take a quick look at what’s new and see how these updates can power up your reports and dashboards. Explore What's New! Extreme

          Zoho CRM Plus Resources

            Zoho Books Resources


              Zoho Subscriptions Resources

                Zoho Projects Resources


                  Zoho Sprints Resources


                    Zoho Orchestly Resources


                      Zoho Creator Resources


                        Zoho WorkDrive 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




                            Zoho Writer Writer

                            Get Started. Write Away!

                            Writer is a powerful online word processor, designed for collaborative work.

                              Zoho CRM コンテンツ





                                ご検討中の方

                                  • Recent Topics

                                  • Let's bring Manufacturing Resource Planning (MRP), Material Requirement Planning (MRP), and Production Planning/Management module / feature in Zohobooks

                                    Let's bring Manufacturing Resource Planning (MRP), Material Requirement Planning (MRP), and Production Planning/Management module / feature in Zohobooks
                                  • Will I see emails sent via campaigns in CRM?

                                    It would be useful for people to be able to see emails sent via campagins in Zoho CRM is that possible?
                                  • Zoho ZUGs Meetups 2026 en España: Descubriendo nuevas posibilidades con Zoho

                                    ¡Hola, Español Zoho Community! Hemos celebrado una nueva edición de los Zoho User Groups (ZUGs) en España (Madrid, Barcelona & Valencia), una excelente oportunidad para reunirnos, formarnos y descubrir nuevas formas de sacar más partido a nuestras herramientas
                                  • What is MCP and How Does It Connect to Zoho Invoice?

                                    If you've ever wished you could just tell your invoicing software what to do, without clicking through menus, pulling up reports manually, or switching tabs every five minutes, that's exactly what the Zoho MCP server is built for. MCP stands for Model
                                  • DYK 7 - Set dependency from Gantt and List view

                                    Did you know task dependencies in Zoho Projects can be managed across different task views? In a project, multiple teams work together towards the same goal but team members prefer accessing data with different perspectives depending on their responsibilities.
                                  • Goods In Transit

                                    Hi I was wondering if anyone had any tips or work-around to show goods in transit as a liability? We raise a PO with our supplier in China and when the goods are shipped and are invoiced, hence they are a liability of the business. However I can't convert
                                  • Accounts Payable and receivable

                                    I'm currently creating my accounts and noticed that I cannot create any more accounts payable or receivable. Is there any way to create more of this accounts and associate them to the default one available?
                                  • How to display Pick List values with vertical separation in Canvas

                                    I have a Multi-Select Pick List whose values I would like displayed vertically. So far, I have only been able to figure out how to adjust the width and other sizing of the field itself or even how to wrap the values to the next line below. I am trying
                                  • Introducing a knowledge management and training software in Zoho Projects Plus

                                    Keeping your workforce updated on emerging technology trends is essential to stay on top of the game. While project management software focuses on planning, execution, and project tracking, incorporating a learning management solution within project management
                                  • Problem with UTM Parameters: Zoho Forms - Zoho Desk Integration

                                    Hi Zoho Support Team, I want to automatically capture UTM Parameters from my website URLs and pass it from Zoho Forms into Zoho Desk. I have activated the UTM tracking feature. I've integrated the UTM Tracking code in my website footer on all pages. I've
                                  • #13 Fix Mistakes Without Breaking Your Records

                                    A customer purchases 100 custom-printed invitations for an upcoming event. A few days after delivery, they call to say that some invitations were damaged and others need to be reprinted. They request a return. The customer isn't asking for a completely
                                  • Zoho Directory : transformez vos données d’identité en décisions de sécurité

                                    Que sont les rapports d’identité dans Zoho Directory et pourquoi sont-ils importants? À mesure que les organisations se développent, la gestion des identités devient plus complexe. Les informations existent, mais elles sont souvent réparties entre plusieurs
                                  • How to use Zoho Billing info in a workflow

                                    We have Zoho Billing and CRM sync'd and the Billing info appears as expected for each Account in Zoho CRM, including subscription status, plan type etc. But how can we use this in a workflow? Thanks Dylan
                                  • Why can't we choose Fixed Asset account for Purchased Items? (eTims issue?)

                                    Hello, When the company purchase items not for sale and not supposed to be in the inventory stock, like equipment for operational use, there is no way to access the Fixed Asset accounts in the drop down list. Is that an eTims limitation again? Or something
                                  • Auto-approval for shared key access not working for new users

                                    Hello, I'm an admin of a Zoho Vault organization (34 active users, ZOHO identity provider). I have the "Auto-approval for shared key access" setting enabled in Settings → Fine-Grained Controls → Global, but it does not work as expected. The problem: When
                                  • Zoho Analytics UI Bug

                                    Hello, all, The Aggregate Formulas in Zoho Analytics' list of fields have a 3-dot menu: If the formula has a long name, the name is not fully visible in the list, and a 3-dot menu is not accessible from it: This is not convenient, especially when the
                                  • Canvases Auto-Skewing/Adding Scroll Bars When They Were Not There Prior

                                    Is anyone else noticing rendering issues in their canvases today? It seems to be mainly icons which now have scroll bars added which makes them all look off, though some fields seemed to revert to squished length as well. Were the icons replaced with
                                  • Marketing Tip #37: Reduce purchase doubts with better product images

                                    When customers shop online, they cannot pick up, turn around, or inspect a product in person. That is why your product images need to do more of the selling. Two simple upgrades can make a big difference: Use zoom-friendly images so customers can look
                                  • Zia Agent built in ChatKit UI does not render markdown

                                    Hi, You have a major shortcoming in the Zia Agent UI. The test UI that is embedded in agents.zoho.com allows you to test the agent has full support for rendering markdown, but your ChatKit UI does not have support for rendering markdown. If I embed it
                                  • GLM 5 not available

                                    Hello, I am trying to setup a Zia Agent using agents.zoho.com. The settings says that GLM5 is among the list of free zoho hosted models available. However, when I try to setup an agent and pick a model from the list only GLM 4.7 Flash is available. How
                                  • Supervisor Rules --> Custom Function

                                    Hello, currently I can't add a custom function to a supervise rule. Is there a reason for this? Background: We have BluePrint managed tickets and actually we have a Supervise rule which should set the ticket to "closed" after 168 hours since the last
                                  • Vault Chrome Extension Asks for Master Password every single time

                                    Is this supposed to be a feature, or is this a bug?  My assumption is that it's a bug, because every time I click on the Extension, there is a red exclamation mark/notification on the Zoho Vault extension.  Is the idea with the Extension that I have to
                                  • Permission Denied for Worklogs URL

                                    We're attempting to pull worklogs data from service desk plus and when using the below URL we are met with a message stating we do not have permission. https://sdpondemand.manageengine.com/api/v3/requests/xxxxxx/worklogs/ We used SDPOnDemand.requests.ALL
                                  • Anyone in Australia using Zoho Books AND has their account with NAB?

                                    Hi I have an account with both NAB and Suncorp. Suncorp transaction come in the next day however NAB transactions take 4-5 business days to appear. eg: A deposit made today in my Suncorp will be imported into Zoho tomorrow. A deposit made today to the NAB account will be imported maybe Saturday (Friday overnight). I have contacted both Zoho and NAB but noone seems to know why. I was just wondering if anyone else in Australia uses NAB and has this issue (or doesn't) maybe we could compare notes and
                                  • Partner with HDFC And Sbi Bank.

                                    Hdfc and sbi both are very popular bank if zoho books become partner with this banks then many of the zoho books users will benefit premium features of partnered banks.
                                  • #12 Never Leave a Billable Hour Behind

                                    A client approves a website redesign project. The estimated effort? 40 hours. The project is going well. A few additional review meetings are scheduled. Several rounds of content changes are requested. A few "quick fixes" get added along the way. The
                                  • Close task on Completion Date entry

                                    This discussion is similar to my issue: "backdated-task-completion-date" discussion Scenario: A bunch of tasks have been completed. But, they have not been closed. Time goes by You finally get around to closing those tasks Projects assigns the date the
                                  • Can I add Conditional merge tags on my Templates?

                                    Hi I was wondering if I can use Conditional Mail Merge tags inside my Email templates/Quotes etc within the CRM? In spanish and in our business we use gender and academic degree salutations , ie: Dr., Dra., Sr., Srta., so the beginning of an email / letter
                                  • Records from ATE 29: Knowledge Base, Community, and AI for smarter user education

                                    Hi Everyone, "Ask the Experts 29" was an engaging session, where we explored how to utilize the Knowledge Base for customers and internal teams, as well as emphasizing the importance of our Community. This post highlights the questions and use cases discussed,
                                  • Kaizen #246 - Incoming Lead Email Intent Detection using Zia Assistant API in Zoho CRM

                                    Hello all! Welcome back to a fresh Kaizen week. In this post, we will explore how Zia detects positive intent from incoming emails in the Leads module using the Zia Assistant API along with Workflow Rules and Custom Functions in Zoho CRM. Use Case Problem
                                  • Smart URL Determination

                                    I would like to see Vault implement some sort of "smart" URL determination. When one starts to add a new username-password combination from a new site, Vault brings in the exact URL of the page from which this is happening. All too often, it looks something
                                  • Removing To or CC Addresses from Desk Ticket

                                    I was hoping i could find a way to remove unnecessary email addresses from tickets submitted via email. For example, a customer may email the support address AND others who are in the helpdesk notification group, in either the TO or CC address. This results
                                  • Tip #76- Exploring Technician Console: Quick Launch- 'Insider Insights'

                                    Hello Zoho Assist Community! Welcome back to our Technician Console series. Last time we explored Power Options, and this time we are turning the spotlight on a feature that quietly saves you dozens of clicks in every session by getting you exactly where
                                  • Multi-Book Accounting Support in Zoho Books

                                    Currently, businesses that operate multiple entities, regions, or divisions need to maintain separate Zoho Books instances or resort to manual consolidation processes. This creates significant operational friction and increases the risk of errors. PROBLEM:
                                  • Automated Multi-Subsidiary Consolidation Engine in Zoho Books

                                    For organizations managing multiple subsidiaries across different geographies or business units, consolidation is a quarterly/annual nightmare. Zoho Books lacks native consolidation tools, forcing companies to export data, manipulate it in Excel, and
                                  • Unable to charge GST on shipping/packing & Forwarding charges in INDIA

                                    Currently, tax rates only apply to items. It does not apply tax to any shipping or packing & forwarding charges that may be on the order as well. However, these charges are taxable under GST in India. Please add the ability to apply tax to these charges.
                                  • How to add packing & forwarding charge in purchase order & quotation???

                                    Hello Zoho Team I have just started using Zoho for my company and I wanted to make purchase order. My supplier charges fix 2% as packing & forwarding on Total amount of material and then they charge me tax. For example, Material 1 = 100 Rs Material 2
                                  • How to book GST paid in zoho books

                                    hi, i am a new user to Zoho books and not able to book GST paid in books, kindly suggest how i can book it in books. thanks, siddharth
                                  • [Bug] WebAuthn passkey registration blocked on rpIds with TLDs longer than 6 characters (.accountant, .technology, etc.) — isValidDomain regex too strict

                                    Hi, Filing on behalf of an enterprise customer where Zoho Vault is deployed across the company. The Chrome extension blocks WebAuthn passkey registration on legitimate sites whose Relying Party ID (rpId) has a TLD longer than 6 letters. This affects every
                                  • Zoho Payroll: Product Updates - H1, 2026

                                    Over the last few months, Zoho Payroll has added updates that make payroll easier to process, review, explain, and manage for businesses. The most important improvements focus on payroll flexibility, gratuity tracking, employee self-service, reporting,
                                  • Next Page