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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Ethel
Creator III
Creator III

SQL query

I have a long sql query that has a lot of unions, pivot tables etc. Is there a simple way I can use it in qlik sense without rewriting it on qlik language? I need to be able to change it in qlik sense and that's why I cannot just copy paste data and enter it manually. 

Please help! 

Thanks a lot in advance!

1 Solution

Accepted Solutions
abhijitnalekar
Specialist II
Specialist II

Hi @Ethel,

Can you please check like below script.

 

LOAD * ;

[Tbl_Qlik_input]:
SELECT id,
cClient,
Element1,
Element2,
Element3,
Element4,
Percentageshift,
Expression
FROM [Qlik_Admin].[cartsn].[TBL_Qlik_Input_DWH];

 

 

Regards,
Abhijit
keep Qliking...
Help users find answers! Don't forget to mark a solution that worked for you!

View solution in original post

11 Replies
abhijitnalekar
Specialist II
Specialist II

Hi @Ethel ,

You can write your query as below to convert it into the Qlik

Table Name:

Load *;

SQL copy your SQL here ;

Regards,
Abhijit
keep Qliking...
Help users find answers! Don't forget to mark a solution that worked for you!
Ethel
Creator III
Creator III
Author

I tried, but I'm getting this error

The following error occurred:
Connector reply error: ErrorSource: Microsoft OLE DB Provider for SQL Server, ErrorMsg: The identifier that starts with ' Datasource, Category,Jul.......<my other columns>' is too long. Maximum length is 128.
 
I have 20 columns in the final result table
 
What should I do? 
abhijitnalekar
Specialist II
Specialist II

Is it possible to share the SQL script?

Regards,
Abhijit
keep Qliking...
Help users find answers! Don't forget to mark a solution that worked for you!
abhijitnalekar
Specialist II
Specialist II

Also, you can go through with the below case then you can get the idea to make the changes in your SQL

 

https://community.qlik.com/t5/QlikView-App-Dev/Nested-Select-using-ODBC-on-Load/td-p/426080 

Regards,
Abhijit
keep Qliking...
Help users find answers! Don't forget to mark a solution that worked for you!
Ethel
Creator III
Creator III
Author

Thank you so much! 

I had to make names of my columns shorter and everything worked fine! No errors...but

when I'm trying to click on Analyze sheet, it tells me that I have to load data first.(Please load your data before moving to the next step)

My script looks like this:

LIB CONNECT TO 'SQL_DB';
Data:
LOAD *;
SQL

Select
;

What else should I do to actually load my data and start working with it?

Thanks a lot in advance!

abhijitnalekar
Specialist II
Specialist II

Hi @Ethel,

I can see the syntax is correct. Is it possible to share the SQL script?   

Regards,
Abhijit
keep Qliking...
Help users find answers! Don't forget to mark a solution that worked for you!
Ethel
Creator III
Creator III
Author

No, I cannot share it

abhijitnalekar
Specialist II
Specialist II

Hi @Ethel,

Can you please check like below script.

 

LOAD * ;

[Tbl_Qlik_input]:
SELECT id,
cClient,
Element1,
Element2,
Element3,
Element4,
Percentageshift,
Expression
FROM [Qlik_Admin].[cartsn].[TBL_Qlik_Input_DWH];

 

 

Regards,
Abhijit
keep Qliking...
Help users find answers! Don't forget to mark a solution that worked for you!
Ethel
Creator III
Creator III
Author

The following error occurred:
Connector reply error: ErrorSource: Microsoft OLE DB Provider for SQL Server, ErrorMsg: Invalid object name 'Qlik_Admin.cartsn.TBL_Qlik_Input_DWH'.
 
The error occurred here:
[Qlik_input]: SELECT id, cClient, Element1, Element2, Element3, Element4, Percentageshift, Expression FROM [Qlik_Admin].[cartsn].[TBL_Qlik_Input_DWH]