Beginners Task Series - Task3(Interval Match)

    All,

     

    Beginners in Qlikview I am back with another scenario i.e. Interval Match.

     

    Scenario:

    I have two tables Employees, Job grades. The task here is to find out the Grade level of the employees. The same can be achieved in SQL as below using joins

     

    Select FIRST_NAME,SALARY,GRADE_LEVEL

    from employees,job_grades

    Where employees.SALARY >= job_grades.LOWEST_SAL and employees.SALARY <= job_grades.HIGHEST_SAL

     

    Coming to Qlik view we do a interval match for this, the following code is what I used.

     

    Directory;

    LOAD EMPLOYEE_ID,

        FIRST_NAME,

        LAST_NAME,

        EMAIL,

        PHONE_NUMBER,

        HIRE_DATE,

        JOB_ID,

        SALARY,

        COMMISSION_PCT,

        MANAGER_ID,

        DEPARTMENT_ID

    FROM

    employees.xlsx

    (ooxml, embedded labels, table is employees);

     

     

    Job_Grades:

    LOAD GRADE_LEVEL,

        LOWEST_SAL,

        HIGHEST_SAL

    FROM

    [job grades.csv]

    (txt, codepage is 1252, embedded labels, delimiter is ',', msq);

     

     

    IntervalMatch(SALARY)

    LOAD LOWEST_SAL,HIGHEST_SAL

    Resident Job_Grades;

     

     

    Note: One noticeable point here is, I couldn't get rid of the synthetic keys. Is there a way that can be done.

     

    Hope this helps.

     

    Thanks

    Kiran Kumar