Dynamic Date Filtering for KPI Widgets – Need Help with Query Table

Dynamic Date Filtering for KPI Widgets – Need Help with Query Table

Hello,
I'm seeking help with setting up dynamic date filtering for my KPI widgets in Zoho Analytics. Below is an overview of my setup and the issues I'm facing:

Why:
I need my KPI widgets to update dynamically based on a date range selected via a dashboard date picker. My goal is to have the entire data chain—from the original source table, through my Query Tables, to the KPI widgets—update automatically when the date range changes.

How:

Original Table Presentation:
    1. My initial data is stored in a wide-format table where each dossier (record) includes separate date columns for different process stages. For example:

      IndexColContactDateMandatDateAccordClientDateSoldeDate
      12024-01-052024-01-092024-01-152024-01-20
      22024-02-032024-02-082024-02-122024-02-20
      ...............


Unpivoted Table ("Unpivoted_CRMKeyed"):

To simplify analysis, I transformed the wide table into a long format using a Query Table, resulting in:

IndexColEtapeDateEtape
1
Contact2024-01-05
1Mandat2024-01-09
1Accord Client2024-01-15
1Solde2024-01-20
2Contact2024-02-03
2Mandat2024-02-08
.........

This unpivoted structure allows me to easily calculate delays between stages and apply a single global date filter on "DateEtape."

Query Tables and KPI Widgets:

First Query Table:
I created a Query Table grouping by IndexCol to calculate delays between stages. For example, to compute the days between "Contact" and "Mandat":

  1. SELECT
  2.     "IndexCol",
  3.     DATEDIFF(
  4.         MAX(CASE WHEN "Etape" = 'Mandat' THEN "DateEtape" END),
  5.         MAX(CASE WHEN "Etape" = 'Contact' THEN "DateEtape" END)
  6.     ) AS "DiffContactMandat",
  7.     -- Additional calculations for other stage delays...
  8. FROM "Unpivoted_CRMKeyed"
  9. WHERE "DateEtape" >= '2024-01-01'
  10.   AND "DateEtape" <= '2024-12-31'
  11. GROUP BY "IndexCol"
This Query Table works perfectly with static dates.

Second Query Table & KPI Widgets:
I then built a second Query Table to aggregate the delay calculations (for example, computing the average delay for each transition) and used these aggregated values as the source for my KPI widgets.

  1. SELECT
  2.     AVG("DiffContactMandat") AS "Moy_ContactMandat",
  3.     AVG("DiffMandatAccord_Client") AS "Moy_MandatAccord_Client",
  4.     AVG("DiffAccord_ClientSolde") AS "Moy_Accord_ClientSolde",
  5.     AVG("DiffContactSolde") AS "Moy_ContactSolde"
  6. FROM "FirstQueryTable"

Sample Result of Second Query Table:

Moy_ContactMandat
Moy_MandatAccord_Client
Moy_Accord_ClientSolde
Moy_ContactSolde
4.8
6.2
7.1
12.3

I then use these aggregated values as the source for my KPI widgets.

Dynamic Date Filtering Issue:
I want to replace the static date values in the Query Tables with dynamic ones controlled by a dashboard date picker (using user variables like ${varDateStart} and ${varDateEnd}). However, when I attempt to do so, I get errors (e.g., "Invalid Date Format" or "Usage of variables in SQL query is not supported"). I've verified that the variables contain strings in "YYYY-MM-DD" format, but the dynamic filtering still fails.

I need guidance or workarounds to implement dynamic date filtering for my KPI widgets in Zoho Analytics. Specifically:

How can I enable a dashboard date picker to update user variables (or otherwise apply dynamic date filters)?
How can I apply these dynamic dates to filter either the original table or the Query Tables, so that the entire KPI chain updates automatically?
Are there any recommended alternative approaches if user variables cannot be used directly in Query Tables?

Any help or suggestions to resolve this issue would be greatly appreciated.

Thanks in advance!

Best regards,

Christophe
    • Sticky Posts

    • [Webinar] Why AI Must Stand on the Solid Foundation of Analytics & Business Intelligence

      Are you prepared for the age of AI? Organizations that have a solid foundation in analytics and business intelligence will be in a better position to harness GenAI, agentic apps, and intelligent automation. Join Doug Henschen and Mike Ni, VPs and Principal
    • Create and save user-specific filter views with Zoho Sheet

      The filters in Zoho Sheet have become even more collaboration-friendly. Previously, whenever you filtered any data, the filtered view will be updated for all the spreadsheet collaborators. This disturbed the data for others working on the same file. With this new update, you can apply data filters without altering the view for other collaborators in the file.   Collaborate with user specific filters   Let us say you are working on a sales report spreadsheet in real time with two remote colleagues. If
    • [UI Update] Mandating New UI for all Zoho Analytics Users

      Dear Users, We’re pleased to share that the new and improved Zoho Analytics 6.0 user interface has already been embraced by many users, delivering a faster, cleaner, and more efficient experience. For the Zoho Analytics users who are still using the old
    • Customer Segmentation using RFM Analysis

      How well do you know your customers? Whether you operate in a B2B or B2C space, chances are that 80% of your business comes from just 20% of your customers (Pareto's Principle). According to a study by Forbes, acquiring new customers costs five times
    • What's New in Zoho Analytics - March 2025

      Hello Users, We're back with the latest set of enhancements and improvements aimed at improving your analytics experience. Common Query Table Expression (CTE) support in Query Tables We’ve added support for Common Table Expressions (CTE) in Query Tables,
    • Recent Topics

    • Zoho Recruit - Automatic email before expiry date

      Hi, how can we automate email going out to candidate if one of the 3 fields are 30 days or less before expiry? All available workflow triggers are update/create/delete based but I want this to be independent of any activity on candidates profile. Is it
    • Add SalesPerson PlaceHolder in Notification

      We have the ability to include only Created By But for my use case I need the sales Person in the Email as well And the subtotal as well Please give us access to Sales Person and Subtotal Placeholders
    • Mobile App Location Features (Check-in, Maps) Not Working for Tasks Related to Deals (Address Data Copied via Function)

      Hello Zoho Community, I'm facing an issue with the Zoho CRM mobile app's location-based features (like check-in suggestions or map pins) specifically for Tasks related to Deals. Goal: I want the mobile app's location features to work for Tasks related
    • Not Able to access Api of Zoho Workdrive.

      I have Zoho One plan. And I am trying to use api of Zoho workdrive and Showing Invalid Client.
    • Flex Your Creativity – A New component to Canvas in Zoho CRM

      Hello Everyone We’re excited to introduce Flex, a new component for Canvas in Zoho CRM! Flex is here to give you greater control over how your data is displayed in your layouts. This component enables responsive layouts that adapt across different screen
    • Create Funnel to Track Email Outreach Conversion

      Hello, We would like to create a funnel that measures: N° of emails sent -> N° of emails opened -> N° of emails responded We would like to measure this email response conversion rate for each of our SDRs. We use the analytics tool of Zoho CRM and not
    • Schedule Zoho CRM reports only on Business Days

      Hello, Is it possible to schedule reports only on business days ? We currently get daily sales reports on weekend which has no value since the sales team doesn't work on weekends. Thanks
    • Presenting the brand new Zoho Bookings!

      Hello everyone, Greetings from Zoho Bookings! We're happy to announce a new version of our product with enhanced features to simplify scheduling, coupled with a sleek interface and improved privacy across teams. Here's what you can expect from the latest
    • Zoho CRM - Rollup Field for "Total Calls TODAY"?

      Good afternoon, I'm trying to build a field that will track the total number of calls made to a lead in one day. This way i can organise my call queues by this to prioritise leads without an attempt. I can put in a Rollup field for *total* calls made
    • Cliq iOS can't see shared screen

      Hello, I had this morning a video call with a colleague. She is using Cliq Desktop MacOS and wanted to share her screen with me. I'm on iPad. I noticed, while she shared her screen, I could only see her video, but not the shared screen... Does Cliq iOS is able to display shared screen, or is it somewhere else to be found ? Regards
    • Feature Request Improve parent-child relationship visibility

      Hi team, The Parent-Child ticket feature is great, but I've struggled to see the relationship between tickets when using ticket list views. It would be a great quality of life enhancement for users if child tickets were nested under parent tickets in
    • Company Name Update and Chatbot Customization

      We would like to request your assistance with the following updates to our Zoho system: Company Name Change: we have integrated chatbot on our website. Please help to change our company name from BVK Infrasoft to BVK Group on chatbot the entire system,
    • Zoho Payroll: Product Updates | April 2025

      At Zoho Payroll, we’re always working to make every payday feel effortless. And sometimes, that means listening closely to your unique needs. This month, we’ve focused on adding features that give you the flexibility to pay your employees based on your
    • Creating task at someones date of birth

      Hi, I want to create a workflow which creates a task at someones date of birth. How can I do this?
    • How do I do a formula to join two fields together like first name and last name into full name?

      Having issues with this in my custom module.  In most CRM systems you would do: FIELD1 & " " & FIELD2 But it gives an error saying I'm not supposed to use double quotations so not sure what that means.  I've tried to read the formula help guide but it's
    • Call transcrition working for ringcentral?

      I don't see anything about what telephony providers can be used. The Zoho support person A said that RingCentral isn't supported. Zoho support person B said that it works, just make sure the call recording link works. Excellent instructions here: Call
    • Zoho CRM in Microsoft Power Automate Custom Data Connector

      Hello, I have set up a custom data connector in Microsoft Power Automate. It is a connector to retrieve Zoho CRM data. I am pretty certain that I have entered the OAuth 2.0 authentication information correctly. However when I test the Get request https://zohoapis.com/crm/v2/leads.
    • How do i move multiple tickets to a different department?

      Hello, i have several tickets that have been assigned to the wrong department.  I am talking about hundreds of automatically generated ones that come from a separate system. How can i select them all at once to move them to another department in one go? I can select them in "unsassigned open tickets view" but i can't find a "move to another department" option. I also can't seem to assign multiple tickets to the same agent in that same view. Could somebody advice?
    • validation function for Stage QC means QC Done fileupload field not empty on Save

      validation function for Stage QC means QC Done field field not empty . if the fileupload has value also it showing the false statement on save how i fix this Also one more concern is Custom validation function work on blue print transaction. ///this is
    • Zoho Support - Again!

      I've been using Zoho One for over 5 years and it seems the level of support just goes from bad to worse. The only thing that has kept me with them this long is the product itself. When something goes wrong, it is a mandatory 2 days wait for a response
    • Quick Create needs Client Script support

      As per the title. We need client scripts to apply at a Quick Create level. We enforce logic on the form to ensure data quality, automate field values, etc. However, all this is lost when a user attempts a "Quick Create". It is disappointing because, from
    • Map Contact to Account record based on email domain

      Hi Community, I'm looking for a (presumably custom) solution to map Contact records to Accounts based on web domain. E.g. new Contact record John Smith with email john.smith@acme.com is automatically mapped to Account record Acme Ltd https://acme.com
    • Edit Project Number?

      Hi all: We just signed up for a trial of zoho one, which includes ZoHo Projects. We've noticed there was a 'dummy project' preloaded in projects to help familiarize yourself with the software. We've created a couple of our own projects now but noticed since the dummy project was preloaded, our projects start with number 2 then 3, sequentially. Since it seems we will be keeping zoho past the trial, If we delete the dummy project, how do we get our own projects renumbered, beginning with 1? We'd like
    • How to integrate single-sign-on using Linkedin in Zoho Creator

      How to integrate single-sign-on using LinkedIn in Zoho Creator need step by step integration.
    • Canvas responsive preview in different browser window causes re-authentication/verification

      I'm trying to design a view in Canvas. I am testing in a tab with a desktop view, and another tab (on my same desktop/IP) with a responsive view of an iphone. Every time I refresh, it boots me out of the previously used tab. If I forget to refresh the
    • The Next Chapter for CRM for Everyone: Moving from Early Access to Phased Rollout for Customers

      #CRM25Q1 Hello Everyone, Until now, CRM for Everyone has been available in early access mode exclusively for users who opted to try the new version. We are now transitioning to a phased release, starting with the basic edition. We are thrilled to announce
    • Second Insight - Let's talk Layouts

      The Wheels of Ticketing - The Desk Stories Let's talk Layouts What are layouts? Layouts refer to the arrangement or design of elements in a space, whether on a physical surface, like a room or a piece of furniture, or in digital contexts, such as web
    • Generate a Zoho Sign link

      From time to time I get a response "I never received your you e-document for electronic signature" is there a way to generate a Zoho Sign link to share.
    • This domain is not allowed to add. Please contact support-as@zohocorp.com for further details

      I am trying to setup the free version of Zoho Mail. When I tried to add my domain, theselfreunion.com I got the error message that is the subject of this Topic. I've read your other community forum topics, and this is NOT a free domain. So what is the
    • Trigger a Workflow Function if an Attachment (Related List) has been added

      Hello, I have a Case Module with a related list which is Attachment. I want to trigger a workflow if I added an attachment. I've seen some topics about this in zoho community that was posted few months ago and based on the answers, there is no trigger
    • Week date range in pivot table

      Hello, I need to create a report that breakouts the data by week.  I am using the pivot table report, and breaking out the date by week, however the date is displayed as 'Week 1 2014' format.  Is there anyway to get the actual dates in there? ex. 1/6/2014-1/12/2014 Thanks,
    • Canvas Flex Box containers should not require a width/height.

      Flexbox containers are often used as organizational concepts, to ease re-flow on mobile etc. - I cannot use % for flexbox W or H - I cannot omit W or H This means that the content cannot dictate, and a Flexbox container cannot be used merely as an organizational
    • Zoho Error: This Operation has been restricted. Please contact support-as@zohocorp.com for further details

      Hello There, l tried to verify my domain (florindagoreti.com.br) and its shows this error: This Operation has been restricted. Please contact support-as@zohocorp.com for further details. Screenshot Given Below -  please check what went wrong. Thanks
    • Data Retention Policy Update – Effective May 1, 2025

      Starting May 1, 2025, we’re updating how long we store your landing page data based on your subscription plan. Here’s the new retention timeline: Trial Plan – 3 months Essentials Plan – 6 months Professional Plan – 9 months Enterprise & Bundle Plans –
    • Backup and Restore of Projects

      Hi Guys, my boss asked me "do we store regulary offline Backups of Zoho Projects" and i could only answer "no way". Is there really no way to backup and restore a project manualy? As Projects is the main Product we decided to use Zoho it could be that
    • Tip of the Week #52 – Use keyboard shortcuts!

      Tired of clicking around often? Navigating can feel slow when you’re switching between threads, views, or composing messages, all using just your mouse. Turn on Keyboard Shortcuts to move around your inboxes faster and work smarter. Once enabled, you
    • FSM Job Sheets data to CRM

      Hello, is there anyway of getting the data collected in the job sheets into the CRM. We are collecting inspection data which we were using zoho forms for but the job sheets in fsm seem like a lot better way to collect it but we need to be able to get
    • An update to improve email delivery | Email Authentication & Relay

      Update Rollout For Trial Users (signed up on or after April 8, 2025) If your email-sending domain is not authenticated, all emails will be sent from Zoho Recruit's authenticated domains by default. This update is now live across all data centers. Once
    • Shopify sales orders creating a new account in Zoho

      Hi all, I am having a slight issue with the shopify integration. Whenever a customer purchases from the store, shopify automatically creates a sales order in inventory. The issue is that it creates a new account for the customer's name instead of attaching
    • Open a popup window from inside Record A and stay on the record after saving Record B

      Hello community, Perhaps you can help me with the following topic. I have a form A with a decision box. When this decision box is checked, a form B pops up. Once Form B is saved, I need to stay on Form A to continue entering data. I've observed the following
    • Next Page