Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
evansabres
Specialist
Specialist

SQL Query

I have an application that utilizes SQL as the data source.

On my home screen, I have a button for users to click that represents different divisions of our brand that they can click on to dive into that data. I want the button to do two things;

1. Activate a sheet, which is easy and I have that already built.

2. Also, when the user clicks on the button, they will query the database to return only data specific to that division. The field that I would want to be querying is called twAccountID      Each division has a numeric value, for this example, when the user clicks on the button I want to return the twAccountID = 1

A sample row of data:

twRecordID          twAccountID         

         20                        1

What is the structure for this search?

1 Reply
Anonymous
Not applicable

You have to do the next steps:

1.- Create a variable in variable panel.

2.- Create a objet of input table using the variable that you have created.

3.- Create a botton with the action 'execute script'.

Note: Your SQL should be  like this

LOAD

   date_created,

    employee_id,

    twAccountID,

    order_status_id,

    paid_date,

    total,

    user_id;

SQL SELECT *

FROM orders

where twAccountID=$(MiVariable);

So you can select the number in the 'input table' and after execute the script with

the botton that you created.