Zoho reports query table problem
Hi,
I wanted to ask you a question regarding one query that I am trying to build so I can make a report out of it.
I had 2 requirements:
1. Get the potentials that have reached the red zone, and the red zone is a percentage of probability for that potential.
2. Get the potentials that have reached the red zone and ended up being won. The red zone will also be chosen in the report slider.
For the first one I solved the problem by using this query :
- SELECT
- potential."POTENTIALID" AS "Potential Id",
- potential."Potential Owner" AS "Potential Owner",
- potential."Potential Name" AS "Potential Name",
- potentialHistory."Modified Time" AS "modified",
- groupedtt."MaxProbability"
- FROM "Potentials" potential INNER JOIN "Potentials Stage History" potentialHistory ON potential."POTENTIALID" = potentialHistory."POTENTIALID" INNER JOIN( SELECT
- "Potentials Stage History"."POTENTIALID" AS "PotentialID",
- MAX("Potentials Stage History"."Probability (%)") AS "MaxProbability"
- FROM "Potentials Stage History"
- GROUP BY "Potentials Stage History"."POTENTIALID"
- ) groupedtt ON potentialHistory."Probability (%)" = groupedtt."MaxProbability".
- AND potentialHistory."POTENTIALID" = groupedtt."PotentialID"
And reporting on max probability on the reports.
Now for the second one I a trying to add to that query these following lines:
- WHERE EXISTS
- (
- SELECT p2."POTENTIALID" FROM "Potentials Stage History" p2 WHERE potentialHistory."POTENTIALID" = p2."POTENTIALID" AND p2."Stage"='Closed Won'
- )
But I am getting this error : "
Unknown table or alias 'potentialHistory' used in select query."
Any help would be greatly appreciated.
Best regards,
Edison Rama
Access your files securely from anywhere
Zoho Developer Community
Deliver unforgettable customer experiences
Deliver unforgettable customer experiences
New to Zoho Marketing Plus?
Everything you need to run your marketing
New to Zoho Marketing Plus?
Everything you need to run your marketing
Zoho Desk Resources
-
Desk Community Learning Series
-
-
-
-
-
-
-
-
-
Sticky Posts
Announcing Zoho Analytics 6.0 Beta!
We are delighted to open up the next major version, Zoho Analytics 6.0 Beta! The new version comes packed with a wide range of functionalities for all persona, namely business users, data analysts, data engineers, and data scientists. Zoho Analytics team
What's New in Zoho Analytics - August 2024
Hello Users! We are back with the latest updates and enhancements made to Zoho Analytics. Keep reading to learn more about them. Connect to the data hosted in the cloud without allow-listing the IP addresses Utilize Zoho Databridge to connect to the data
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
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 Campaigns Resources
Zoho CRM Resources
Zoho Show Resources
Writer Get Started. Write Away!
Writer is a powerful online word processor, designed for collaborative work.