Qlik Community

New to Qlik Community

Discussion board for questions on how to use Qlik Community and its features.

Not applicable

How to Pass Dynamic Parameters from QlikView Tables or List Box back to the SQL Query in Script Window ?

Hi,

I was working on the below queries

As the first query loads the Dates into QlikView from where user should be able to select the dates on which the SP need to execute and give the result set.

SQL Select Date as StartDate, Date as EndDate from Dim_Date where Calendar_Year in ('2013','2014');

SQL EXEC ('[dbo].[usp_rpt_MonthlyRevenue_bySource] "$(vStartDate)", "$(vEndDate)"  ' )

Can any one let me know the process to pass those values using variables.

Thanks in Advance.

3 Replies

Re: How to Pass Dynamic Parameters from QlikView Tables or List Box back to the SQL Query in Script Window ?

Hi,

Try like this

SQL EXEC [dbo].[usp_rpt_MonthlyRevenue_bySource] '$(vStartDate)', '$(vEndDate)';


Let me know if that worked.


Regards

ASHFAQ

Not applicable

Re: How to Pass Dynamic Parameters from QlikView Tables or List Box back to the SQL Query in Script Window ?

Hi Ashfaq,

Thanks for responding, below is the error i got

ErrorSource: Microsoft OLE DB Provider for SQL Server, ErrorMsg: Error converting data type varchar to date.

SQL EXEC [dbo].[usp_rpt_MonthlyRevenue_bySource] 'StartDate', 'EndDate'

Thanks in Advance

Re: How to Pass Dynamic Parameters from QlikView Tables or List Box back to the SQL Query in Script Window ?

HI,

Make sure your variable '$(vStartDate)', '$(vEndDate)'

Holds proper date formats.

Regards

ASHFAQ

Community Browser