5 Replies Latest reply: Aug 10, 2017 9:19 AM by Veronica Cruz RSS

    I question related to the Connect and SQL SELECT statement

    Veronica Cruz

      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

        • Re: I question related to the Connect and SQL SELECT statement
          Sasidhar Parupudi

          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;

          • Re: I question related to the Connect and SQL SELECT statement
            Lech Miszkiewicz

            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.