4 Replies Latest reply on Jan 18, 2012 7:24 PM by Adam Goodwin

    Parameters in custom SQL queries

    Adam Goodwin

      Hi,

       

      I have the following query that I'd like to use:

       

      select count(*) LongStayingPatients

      from Encounters e -- Encounter is a patient's visit

            inner join Admissions ax -- When the patient arrives

                  on e.EncounterID = ax.EncounterID

            inner join Assignments a -- The components of a patient's visit

                  on e.EncounterID = a.EncounterID

      where

            a.AssignmentDate<'2010-03-01 07:00'

            and (a.AssignmentEndDate > '2010-03-01 07:00' or a.AssignmentEndDate is null)

            and datediff(hour, ax.AdmissionDate, '2010-03-01 07:00') > 96

       

      Except in place of '2010-03-01 07:00' and 96, I'd like to have parameters that the user of the dashboard can enter. As I understand it, there's currently no way of doing this with Tableau, but I'd just like to confirm that there's no workaround to achieve this?

       

      Thanks