5 Replies Latest reply: Oct 31, 2016 10:22 AM by nani r RSS

    Scripting

    nani r

      Dear Team,

       

      Please resolve my scripting.

       

                       Actually this is my query but I require Scripting in Qlikview.


      (select d.LONGDESC from ptrnpf ptr ,descpf d where ptr.BATCTRCDE=d.DESCITEM and d.DESCITEM='T6188'  and ptr.TRANNO = (select max(p.TRANNO ) from ptrnpf p where p.CHDRNUM=ch.CHDRNUM )) Last_event_name,   

        

       

      (SELECT (cli.idnprf)  FROM clrrpf clr LEFT OUTER JOIN clprpf cli    ON (cli.clntnum = clr.clntnum)   

      AND clr.used2b IS NULL     AND clr.forecoy = '2'     AND clr.forepfx = 'CH'      AND cli.validflag = 1   

      WHERE clr.clrrrole = 'OW'  AND SUBSTR (clr.forenum, 1, 8) = ch.chdrnum    AND ROWNUM < 2) OWNER_ID_PROOF



      Thanks


        • Re: Scripting
          Marco Wedel

          Why do you require to implement this query as QlikView script?

          Did you try to use it as-is?

           

          regards

           

          Marco

            • Re: Scripting
              nani r

              Hi Marco,

               

              Thanks for your response, It is need to develop QV application. Last_event_name and OWNER_ID_PROOF are fields only.

               

              Thanks

              Nani

                • Re: Scripting
                  Marco Wedel

                  Sorry, I don't follow.

                  Can you elaborate on your requirements?

                   

                  thanks

                   

                  regard

                   

                  Marco

                    • Re: Scripting
                      nani r

                      Dear Macro,


                      Based on this query, I did write QV scripting, If it is not correct please correct me. At the same time one more query is there, for that query please give me QV scripting same as below QV scripting.



                      (select d.LONGDESC from ptrnpf ptr ,descpf d where ptr.BATCTRCDE=d.DESCITEM and d.DESCITEM='T6188'  and ptr.TRANNO = (select max(p.TRANNO ) from ptrnpf p where p.CHDRNUM=ch.CHDRNUM )) Last_event_name,


                      A:

                      Load

                      field1,

                      field2,

                      .

                      .

                      .

                      TRANNO,

                      BATCTRCDE  as  Key,

                      LONGDESC   as  Last_event_name


                      from (path)ptrnpf.qvd(qvd);


                      inner join


                      Load


                      DESCITEM    as   Key


                      from (path)descpf.qvd(qvd)

                      where DESCITEM='T6188';



                      B:

                      Load

                      *,

                      max(TRANNO)  as  Maxtran

                      resident A

                      where TRANNO='Maxtran';


                      Thanks,

                      Nani

                    • Re: Scripting
                      Anand Chouhan

                      Can you use this query as a view on the SQL part and then you can use it as table in qlikview by reading view into qlikview that will help you alot.

                       

                      Regards,

                      Anand