Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sql query to Qlikview Script..

Hi Friends,

I have below sample SQL Query which I need to convert into equivalent Qlikview (AQL) Script. Please guide me accordingly.

SELECT student_clasification_SOURCE  student_source

      ,ei.e_item_id

      ,EI.E_ITEM_DATE

      ,EI.E_TYPE Expnd_type

      ,(SELECT   e_category

               FROM   table12

              WHERE   ex_type = ei.ex_type)

               EXPND_CATEGORY

      ,DECODE (EI.SLI_FUNCTION,

                   'USG',

                   'Usages',

                

                   'PJ',

                   'Miscellaneous ') Type_Class

      ,p.segment1          project_number

      ,x.E_GROUP       Expenditure_batch

      ,x.CR_DATE     Expnd_batch_creation_date

      ,(SELECT   p.full_name

               FROM   Ptable11 p

              WHERE   p.student_id = x.incurred_by_student_id

                      AND EI.Actual_date BETWEEN p.effective_start_date

                                                       AND  p.effective_end_date)

               EMPLOYEE_NAME

       ,(SELECT   DECODE (p.current_employee_flag,

                              'Y', p.student_number,

                              NVL (p.npw_number, p.student_number))

               FROM   table11 p

              WHERE   p.student_id = x.incurred_by_student_id

                      AND ei.Actual_date BETWEEN p.effective_start_date

                                                       AND  p.effective_end_date)

               student_NUMBER

       ,x.incurred_by_student_id Student_id

FROM   Table1 P,

       Table2 T,

       Table3 I,

       TAble4 X,

       Table5 PT,

       Table6 TR,

       TAble7 O1,

       TAble8 J

WHERE T.field7 = P.field7

      AND I.field6_ID = P.field6_ID

      AND P.filed4type = PT.field4type

      AND P.field3_ID = PT.field3_ID

      AND I.field2_ID = T.field2_ID

      AND I.field1_ID = X.field1_ID

    

   AND NVL (I.OVERRIDE_TO_ORGANIZATION_ID,

               X.IN_BY_ORGANIZATION_ID) = O1.ORGANIZATION_ID

    

   AND I.sub_ID = J.sub_ID(+)

      AND I.classification_SOURCE = TR.classification_SOURCE(+)

      AND tr.student_clasification_SOURCE is null

--order by x.in_by_Student_id      ;

Regards,

Niki

12 Replies
agomes1971
Specialist II
Specialist II

Hi,

Nikitha,

you have to follow the instructions from Jonathan.

It's hard to help you without acess to data.

I'll try to do the scripting anyway.

André Gomes

Anil_Babu_Samineni

You are using

SELECT student_clasification_SOURCE  student_source

      ,ei.e_item_id

      ,EI.E_ITEM_DATE

      ,EI.E_TYPE Expnd_type

      ,(SELECT   e_category

               FROM   table12

In that, Where do you use this ei, EI

FROM   Table1 P,

       Table2 T,

       Table3 I,

       TAble4 X,

       Table5 PT,

       Table6 TR,

       TAble7 O1,

       TAble8 J

Best Anil, 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
ramkrishna86
Creator II
Creator II

Hi Nikitha,

Use the expression like below to convert SQL select statement to QlikView-

SQL SELECT "CUST_ID",

    "ORDER_ID",

    "SALE_DATE"

FROM Test.dbo.CUSTMERORDERS;

Thanks,

Ram Krishna