3 Replies Latest reply: Apr 4, 2013 12:46 PM by Prasad Dumbre RSS

    Sql from presentation

      i have 3 documents in the aplication architecture

      Extraction

      Model

      Presentation

       

      in the extraction qvw i make a sql in the data base and store it in a qvd file

      then i load it and transform it in the model qvw.

      and in the presentation qvw show some data (expresions calculations charts)

       

      this sql is executing with a date parameter Today.

       

      but now in the presentation qvw i have a calendar table

       

      and i need

       

      if i select a date in this calendar filters make the sql extraction not with the parameter today

      make sql from presentation with this selected date

      transform it in the model qvw

      and show the same data (expresions calculations charts) but of the selection i made.

       

      how i can do this.....

        • Re: Sql from presentation
          Prasad Dumbre

          Hi Carlos,

           

          What you can do here is, store selected datevalue from calendar into a variable, then store that variable value in .txt file or other file on click of button or trigger.

          Once you do that, open your extraction .QVW, and read value from that .txt or other file and use this value as a parameter while fetching data from sql.

          But make sure you always have value in that file from which you are fetching . . .

            • Re: Sql from presentation

              Hi, prasad,

               

               

              can i execute the extraction .QVW automatically and assign this value from the clik button or trigger??

              without open it

                • Re: Sql from presentation
                  Prasad Dumbre

                  Hi Carlos,

                   

                  In Presentation qvw, you can save variable value into a txt file using macro.

                  In same qvw, using macro or a button Action (Button Properties->Action->External->Open QlikView Document)

                  you can open the extraction.qvw.

                   

                  Now, In document properties of extraction.qvw, you have trigger on open document. using this you can reload your application. Means each time application gets opened it will reload automatically due to this trigger.

                   

                  Now, you only have write script in extraction.qvw to fetch data (a date) from txt file as a field and use it as a parameter for restricting the data extraction.

                   

                  I Hope it was helpful to you . .