Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have some set of SQL queries in excel sheet and I want to load this queries in Qlikview and perform the SQL queries in Qlikview.
Can anyone help on the same?
You can load your queries direct from the Excel file and pass the query into a variable like this example ...
/*Example Data (held in Excel file called SavedQueries.xslx)
QueryID QueryDesc Query
1 OrdersDelivered SELECT OrderID, OrderStatus FROM Orders WHERE OrderStatus = 'Delivered'
2 OrdersOutstanding SELECT OrderID, OrderStatus FROM Orders WHERE OrderStatus = 'Outstanding'
3 OrdersInProgress SELECT ….
4 OrdersPaused SELECT ….
5 InvoicedByMonth SELECT InvoiceMonth, sum(InvoiceValue) as TotalInvoiced FROM Invoices Group By InvoiceMonth
*/
Queries:
LOAD QueryID, QueryDesc, Query FROM SavedQueries.xlsx (ooxml, embedded labels, table is Sheet1);
//Lookup the value 'InvoicedByMonth' in field 'QueryDesc' in table 'Queries' and return the value in field 'Query'
//Values in QueryDesc must be unique
Let SQLCmd = Lookup( 'Query', 'QueryDesc', 'InvoicedByMonth', 'Queries' );
OLEDB CONNECT TO [...] (XPassword is ...);
InvoicedByMonth:
Load *;
SQL $(SQLCmd);
flipside
Should share that Queries with us, Or else how we understand which Query you have? All SQL may / May not implement in Qlikview. But, Qlik has that power
Copy and Paste??
I have some basic list of queries for oracle which works very well in Qlikview.
eg: desc table name ;
Select count(*) from table name;
select * from table name;
I want to extract that query and run in qlikview.
You can load your queries direct from the Excel file and pass the query into a variable like this example ...
/*Example Data (held in Excel file called SavedQueries.xslx)
QueryID QueryDesc Query
1 OrdersDelivered SELECT OrderID, OrderStatus FROM Orders WHERE OrderStatus = 'Delivered'
2 OrdersOutstanding SELECT OrderID, OrderStatus FROM Orders WHERE OrderStatus = 'Outstanding'
3 OrdersInProgress SELECT ….
4 OrdersPaused SELECT ….
5 InvoicedByMonth SELECT InvoiceMonth, sum(InvoiceValue) as TotalInvoiced FROM Invoices Group By InvoiceMonth
*/
Queries:
LOAD QueryID, QueryDesc, Query FROM SavedQueries.xlsx (ooxml, embedded labels, table is Sheet1);
//Lookup the value 'InvoicedByMonth' in field 'QueryDesc' in table 'Queries' and return the value in field 'Query'
//Values in QueryDesc must be unique
Let SQLCmd = Lookup( 'Query', 'QueryDesc', 'InvoicedByMonth', 'Queries' );
OLEDB CONNECT TO [...] (XPassword is ...);
InvoicedByMonth:
Load *;
SQL $(SQLCmd);
flipside
Thanks for the answer.