Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
vqcruzcabeza
Contributor II
Contributor II

I question related to the Connect and SQL SELECT statement

Hi everyone

I am new to Qlik Sense app.  Learning by my own.  Using a book reference and trying to do the exercises.  At this point I have been trying to do a simple Select command and I am stuck.  I load a Excel table.  This is the script:

[HumanResources_Employee]:

LOAD [EmployeeID],

  [NationalIDNumber],

  [ContactID],

  [LoginID],

  [ManagerID],

  [Title],

  [BirthDate],

  [MaritalStatus],

  IF(Gender='M','Male','Female') AS [Gender],

  [HireDate],

  [SalariedFlag],

  [VacationHours],

  [SickLeaveHours],

  [CurrentFlag],

  [rowguid],

  [ModifiedDate]

FROM [lib://Veronica_Tables (oatpro_vcc8908)/HumanResources_Employee2.xlsx]

(ooxml, embedded labels, table is HumanResources_Employee);

I have to code in the Data Load Editor the following:

SQL SELECT *

FROM 'HumanResources_Employee2.xlsx'

WHERE EmployeeID  < 10

But once I code the SQL Statement I start getting a CONNECT error.   I've trying with every CONNECT statement and youtube and blog reference but something so simple I can't find a solution.

Can anybody help me?

Regards,

Veronica

1 Solution

Accepted Solutions
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi Veronica,

Qlik can execute SQL Select statement when you point it to database. Once data is loaded you can re-use loaded table using "Resident" statement.

Other statements which Load data are :

Load - Inline

Load - Autogenerate

Load - From (this is the one you used to load your excel)

If your task was simply to load a table from excel where employeeId <10 than you could put Where clause on "FROM" statements like this:

[HumanResources_Employee]:

LOAD [EmployeeID],

  [NationalIDNumber],

  [ContactID],

  [LoginID],

  [ManagerID],

  [Title],

  [BirthDate],

  [MaritalStatus],

  IF(Gender='M','Male','Female') AS [Gender],

  [HireDate],

  [SalariedFlag],

  [VacationHours],

  [SickLeaveHours],

  [CurrentFlag],

  [rowguid],

  [ModifiedDate]

FROM [lib://Veronica_Tables (oatpro_vcc8908)/HumanResources_Employee2.xlsx]

(ooxml, embedded labels, table is HumanResources_Employee)

Where [EmployeeID]  < 10 

;

You have to start learning from beginning. I suggest you go through this brilliant 10$ book - it covers everything from very beginning:

QlikView 11 for Developers | Now just $10

I understand you are working with Qlik Sense, but scripting you can learn also in QlikView. There are only small variances in connection libraries, so you should be OK. This book comes with tonnes of example and tonnes of case studies. For beginners is a 100% MUST

cheers

Lech

---------------------------------------------

When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads as HELPFUL if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads as HELPFUL if you feel additional info is useful to others.

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.

View solution in original post

5 Replies
sasiparupudi1
Master III
Master III

Hi veronica

You do not need sql here as you have alresdy loaded the table using excel file.

Final:

Noconcatenate Load *

Resident HumanResources_Employee

WHERE EmployeeID  < 10

Drop table HumanResources_Employee;

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi Veronica,

Qlik can execute SQL Select statement when you point it to database. Once data is loaded you can re-use loaded table using "Resident" statement.

Other statements which Load data are :

Load - Inline

Load - Autogenerate

Load - From (this is the one you used to load your excel)

If your task was simply to load a table from excel where employeeId <10 than you could put Where clause on "FROM" statements like this:

[HumanResources_Employee]:

LOAD [EmployeeID],

  [NationalIDNumber],

  [ContactID],

  [LoginID],

  [ManagerID],

  [Title],

  [BirthDate],

  [MaritalStatus],

  IF(Gender='M','Male','Female') AS [Gender],

  [HireDate],

  [SalariedFlag],

  [VacationHours],

  [SickLeaveHours],

  [CurrentFlag],

  [rowguid],

  [ModifiedDate]

FROM [lib://Veronica_Tables (oatpro_vcc8908)/HumanResources_Employee2.xlsx]

(ooxml, embedded labels, table is HumanResources_Employee)

Where [EmployeeID]  < 10 

;

You have to start learning from beginning. I suggest you go through this brilliant 10$ book - it covers everything from very beginning:

QlikView 11 for Developers | Now just $10

I understand you are working with Qlik Sense, but scripting you can learn also in QlikView. There are only small variances in connection libraries, so you should be OK. This book comes with tonnes of example and tonnes of case studies. For beginners is a 100% MUST

cheers

Lech

---------------------------------------------

When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads as HELPFUL if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads as HELPFUL if you feel additional info is useful to others.

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.
vqcruzcabeza
Contributor II
Contributor II
Author

Good morning, Mr Lech:

Thank you for pointing me into the right direction.  I am using right now the book:  Qlik Sense for Beginners from Mark O'Donovan.  The exercise I am having trouble is form page 69.  Also, using for reference QlikView your Business from Oleg Troyansky and another book Learning Qlik Sense The Official Guide 2nd ed..  I will try your recommendation and let you know.

Thank you very much for taking time to respond my question.  I really appreciated.

PD English is not my first language, sorry for any grammar error.

Regards,

Veronica

vqcruzcabeza
Contributor II
Contributor II
Author

Hi, Mr Parupudi:

I will try it and let you know.  But, I am learning from a book, I am suppose to learn coding SQL transact in the Data Load Editor in order to move forward in the exercises.

I appreciated that you take from your time to answer.  I will try it.

Regards,

Veronica

vqcruzcabeza
Contributor II
Contributor II
Author

Hi Mr Lech:

It worked perfectly.  Thank you very much.

I was checking the book you told me.  In the US is much higher the price but definitely I will buy it.

Have a great day!

Regards, Veronica