
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
how to use SQL Query
Hi,
Can i use the below SQL query directly while loading the data into Qlik sense. So that it will only load where the below query works and pull the necessary data from SQL database.
SELECT Customers.CustomerName, Orders.OrderID
FROM Customers
LEFT JOIN Orders
ON Customers.CustomerID=Orders.CustomerID
ORDER BY Customers.CustomerName;
Thanks
- Tags:
- sql query

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Prasanta,
You are going to want to check out the New to Qlik Sense Videos. They are full of useful information. New to Qlik Sense Videos
There is a section on Data Loading & Modeling. You can find what you are looking for there.
Basically you are going to create a connection to your SQL database. Then you are going to connect using that connection. You can then build your query/load statement from there.
Something like this:
LIB CONNECT TO 'MyDBConnection';
LOAD
CustomerName as [Customer Name],
OrderID as [Order ID];
SQL SELECT Customers.CustomerName, Orders.OrderID
FROM Customers
LEFT JOIN Orders
ON Customers.CustomerID=Orders.CustomerID
ORDER BY Customers.CustomerName;
Hope this helps.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As a tip. If you are going to load from SQL I recommend loading from a view (on the Server Db instance side).
This abstracts any complex to very complex query structures and you/your users etc don't need to be concerned with SQL syntax.

.png)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes you can use any valid SQL query in Qliksense/Qlikview to load the data from databases..
Regards,
jagan.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, You can. Similar threads like you?


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Prasantha,
You can use a sql query like this in your script:
[data]:
load *;
SQL
SELECT Customers.CustomerName, Orders.OrderID
FROM Customers
LEFT JOIN Orders
ON Customers.CustomerID=Orders.CustomerID
ORDER BY Customers.CustomerName;
Thanks,
Sangram.
