huafist commented on issue #31913:
URL: https://github.com/apache/superset/issues/31913#issuecomment-2629480033

   @sujiplr so as I mentioned, I'm using openquery to execute a stored 
procedure that returns the data that I need. The stored procedure takes 2 
parameters - Start Date, End Date. 
   The SQL statement I'm using in the data source is:
   select 
     Office,
     RegionID,
     DateEntered,
     Open_Reqs,
     Placed,
     FillRatio
   from openquery([LOOPBACK], 
   'exec [DBName].[dbo].[SPName]
    @StartDate = '' {{ from_dttm }}'',
    @EndDate = ''{{ to_dttm }}''
   ')
   
   My end goal is a bar chart that I can add dashboard filters to that will let 
me change the date range, or filter the results by regionID. I added the 
following to the "Template Parameters" in the dataset's settings:
   {   
       "_filters": [
        {
          "region": ["1", "4", "5", "6"]
        }],
        "from_dttm":"2024-11-04",
        "to_dttm":"2024-11-10"
    }
   
   Formatted in this way, it lets me filter by region, but the start and end 
dates are hard coded and do not change.
   If I move the variables around:
   {   
       "_filters": [
        {
          "region": ["1", "4", "5", "6"],
          "from_dttm":"2024-11-04",
          "to_dttm":"2024-11-10"
        }]
    }
   Then the date filters work, but I get an error on the Region filter that 
says "Error: (8114, b'Error converting data type varchar to 
smalldatetime.DB-Lib error message 20018, severity 16:\nGeneral SQL Server 
error: Check messages from the SQL Server\n')" 
   I'm assuming that it's complaining because there's no default value being 
passed for start date or end date, thus it can't get the region codes from the 
data set.
   I would imagine this is a fairly trivial fix, but for the life of me, I have 
not been able to resolve it.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org
For additional commands, e-mail: notifications-h...@superset.apache.org

Reply via email to