2 Replies Latest reply: Jul 18, 2013 11:03 AM by Beth Raymond RSS

    Selecting variables when executing stored procedure in script

    Beth Raymond

      Im trying to select variables and alternate variables into parameters while executing a stored procedure in SQL via my qlikview script. What is the proper syntax for stating an alternate variable?


      this is the original statment


      SQL EXEC mtzcus_ActiveMedList_60 '$(vFactoP)', '$(vFromDt)', '$(vToDt)','N';




      I would like to replace 'vFromDt' with 'vFromDt2' when' vFactoP'='MOH'



      I tried this, but it didnt work:


      SQL EXEC mtzcus_ActiveMedList_60 '$(vFactoP)', If((vFactoP='MOH')'$(vFromDt2)')'$(vFromDt)', '$(vToDt)','N';


      Any help is appreciated..