Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to pass input box value to sql query as a parameter?

Hi All,

I am trying to achieve something here, can you please help me out here. Below is what I am trying to do:

In my QV application, I need run a sql query that takes parameters from the user, so I was thinking to have input box where in the user can enter the value, this value would be save in a variable and then the user will reload the app? Do you think this would work? I am just getting confused. Any help here would be greatly appreciated.

Example Select * from tablename where date = : p_date

p_date is given by the user.

So,. should I make this as an input box and save its value in a variable so that on reload, what ever date the user has entered that will be used in the query?

Thanks

1 Solution

Accepted Solutions
qlikmsg4u
Specialist
Specialist

Hi Pragathi,

You are right that's possible (But only in Desktop).Please find the attached app

View solution in original post

8 Replies
qlikmsg4u
Specialist
Specialist

Hi Pragathi,

You are right that's possible (But only in Desktop).Please find the attached app

phaneendra_kunc
Partner - Specialist III
Partner - Specialist III

Assuming user will on Desktop, or other wise they dont even see the realod option. Unless you are using some thing like EDX and Webservices.

Use it like below. p_date is your variable. In this case you can create a calendar object and assign this p_date as a variable. so that your user selections will gets stored in this variable and you can use this in the sql code to filter.

Select * from tablename where date = '$(p_date)'

Not applicable
Author

Thanks very much, this is exactly what I was looking for.

You are a star. 😄

ashfaq_haseeb
Champion III
Champion III

Hi,

Check this

  1. LET vDate = Input('Input Date', 'Warning!');  
  2. Select * from tablename where date = $(vDate)

Regards

ASHFAQ

Not applicable
Author

Thanks for your response, the user is actually using desktop version, so he will have access to the reload button. You response is also the same as QLIKmsg4u‌ He just supplied with an example which is what I was looking for.

Thanks once again,

Not applicable
Author

Can you please tell me what does vShow variable do? where is it used in your example application?

Thanks

qlikmsg4u
Specialist
Specialist

Hi Prahathi,

Variable vShow has nothing to do with your requirement, i used it for other purpose

Not applicable
Author

Ohh Okay, thanks