1 Reply Latest reply on Aug 2, 2016 6:08 PM by Andrew Watson

    Can I pass filter value as parameter in Tableau custom SQL?

    Balaji Kannan

      I have below SQL and I need to pass values selected in "start date", "End date" and "Recon Area" filters to this SQL? Is it possible in tableau to do that

       

      If it's possible - could you guys let me know how to do that?

       

      select distinct file_type, discrepancy_type, account_id,

        decode(upper(trim(action_taken)),'UPDATE UHIP AND SEND MANUAL REQUEST','MANUAL','SEND MANUAL REQUEST','MANUAL' ,'UPDATE UHIP AND RETRIGGER EDI','EDI','RETRIGGER EDI','EDI',upper(trim(action_taken))) action_taken

        from uhip_dm_prd2.dim_discrepancy dd

        where (status = 'Open'

          and trunc(discp_start_dt) < '01-JUL-2016' --FROM_DATE FILTER VALUE

          and upper(high_level_rca) <> 'NO VARIANCE'

          and file_type like 'Recon%' --RECON AREA FILTER VALUE

              )

        or  (status = 'Closed'

          and trunc(discp_start_dt) > '01-JUL-2016' --FROM_DATE FILTER VALUE

          and trunc(discp_end_dt) < '31-JUL-2016'--TO_DATE FILTER VALUE

          and upper(high_level_rca) <> 'NO VARIANCE'

          and file_type like 'Recon%' --RECON AREA FILTER VALUE

              )

       

      The above highlighted ones are needs to be replaced with the values selected in the filter