2 Replies Latest reply: Apr 20, 2016 6:43 AM by Mario Di Loreto RSS

    Select rows and execute function calls

    Mario Di Loreto

      Hello Experts,

      i need to execute in Qlikview one or more functions calls depending by rows selected.

       

      The qvw file contain 6 functions and sometimes i need to run 1 function , sometimes 2, 3 , etc..

       

      Actually i have a tab with calls list to comment or uncomment. It's very bad system i suppose.

       

      Example of script i use today:

       

      //call Option 1;

      call Option 2;

      //call Option 3;

      call Option 4;

      call Option 5;

      //call Option 6;

       

       

      This picture is an template i wish obtain.

      IC354226.jpg

       

      I hope this is possible in Qlikview.

       

      Many Thanks!

       

      anonymousjimhalpertafderikabgh

        • Re: Select rows and execute function calls
          Srikanth P

          You may try like below:

           

          Assume you added the Data Island table with Options. So you can select any option you want with LB object.

           

          Create a variable vGetOptionList = Concat(Options,'|');

           

          In the script, add IF cond for each Call

           

          IF Wildmatch('$(vGetOptionList)','*option1*) THEN

               Call FunctionOption1

          ENDIF

           

          IF Wildmatch('$(vGetOptionList)','*option2*) THEN

               Call FunctionOption2

          ENDIF

           

          IF Wildmatch('$(vGetOptionList)','*option3*) THEN

               Call FunctionOption3

          ENDIF

           

          IF Wildmatch('$(vGetOptionList)','*option4*) THEN

               Call FunctionOption4

          ENDIF

           

          IF Wildmatch('$(vGetOptionList)','*option5*) THEN

               Call FunctionOption4

          ENDIF

            • Re: Select rows and execute function calls
              Mario Di Loreto

              Hi dathu.qv i have tried but doesn't work.

               

              Snap 2016-04-20 at 12.17.10.png

              In START Button i have expression:

               

              IF Wildmatch('$(vGetOptionList)','AAA') THEN

                   call AAA;

              ENDIF

               

              IF Wildmatch('$(vGetOptionList)','BBB') THEN

                   call BBB;

              ENDIF

               

              IF Wildmatch('$(vGetOptionList)','CCC') THEN

                   call CCC;

              ENDIF

               

              IF Wildmatch('$(vGetOptionList)','DDD') THEN

                   call DDD;

              ENDIF

               

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

               

              In main script i have:

               

              vGetOptionList = Concat(Options,'|');

               

              Funzioni:

              LOAD * INLINE [

                 Funzione, posizione

                  AAA, 1

                  BBB, 2

                  CCC, 3

                  DDD, 4  

              ];

               

              In script tab "AAA" :

              Sub AAA

                Msgbox("You called AAA");

              end Sub

               

              When i select one or more test field (AAA, BBB ecc.) and press Start button dont happen nothing.

               

              Helllp