7 Replies Latest reply: Apr 15, 2011 12:45 PM by John Witherspoon RSS

    Start date to end date

      hi,

      i have very huge data base which has date wise data, Is that possible to write a script such that in the beggining it self will ask the start date and end date??? as in our usual portals

        • Start date to end date
          Logesh Jayaraman

          Are you looking for prompting the From and To dates so that user provides the input based on which the QVW will be reloaded. As of now not feasible but i am also looking forward for this option. Guys correct me if i am wrong on this

          Or

          Define the duration in the script for which the data has to loaded into QVW file. This is possible.

           

          • Start date to end date
            Tim Benoit

            I usually create a separate tab to be used for user input and then put one or more inputbox objects there so that the user can enter things like start and end dates that are stored in variables. Then the loadscript can refer to the variables when the user clicks the Reload button.

            If you like the idea of the document asking the user to enter start and end date then you could do this: Create a variable to hold the start date and a variable to hold the end date. Then, code a short macro in the module code like the GET_PARAMETERS macro shown below. Set up a trigger to run the macro when the document is opened and every time the document is opened it will ask for a start date and end date. If you like, you could add an ActiveDocument.ReLoad statement as the last statement.

            Sub GET_PARAMETERS:
            '/* Have user enter start and end date when document is opened */
            indate=inputbox("Enter Start Date in mm/dd/yyyy format")
            ActiveDocument.Variables("var_START_DATE").SetContent indate, True
            indate=inputbox("Enter End Date in mm/dd/yyyy format")
            ActiveDocument.Variables("var_END_DATE").SetContent indate, True
            End Sub

             

            • Start date to end date
              Logesh Jayaraman

              Thanks Tim and John,

              But it will be useful when QVW file is accessed by user through the Qlikview developer environment.We will not be able to schedule it through publisher . Will the functionality work when the QVW file accessed through Accesspoint. Or is there any other way using OCX /workbench to implement the function to prompt for user input at the accesspoint.

               

                • Start date to end date
                  Miguel Angel Baeyens de Arce

                  Hello,

                  I haven't tried the following in a server environment, but it mat be worth trying. It doesn't uses macros, just variables. I usually use it at the beginning of the script:

                   

                  LET vStartDate = Input('Please specify the starting date in format DD/MM/YYYY', 'Warning');


                  When used in Desktop, this opens a dialog prompting the user to specify a date, and store the input from the user in the variable.

                  You can check if that works in a server-client environment so you can use later that vStartDate variable (in your expressions).

                  Hope that helps.

                • Start date to end date
                  Logesh Jayaraman

                  Thanks Miguel,

                  But i doubt it will work in the Accesspoint using the Qlikview webserver.Attached document says that there is no backward communication from QlikView Server to QlikView Publisher. The QVW files will be reloaded in publisher and placed in QlikView Server (one way communication) and which will be accessed by the user through Accesspoint.

                  Other way is

                  Place the QVW file in the publisher and dont not shchedule the reload through publisher.

                  Write a macro to reload using the Button.

                  I am not sure how it is going to work . I am trying the second option as suggested by Miguel using variable and got struck.

                   

                   

                    • Start date to end date
                      John Witherspoon

                      Yeah, I don't think the variable approach would work in AccessPoint. But I'm failing to see how ANYTHING could do what you want in AccessPoint. The reloads are scheduled, not submitted by a user. They are also on the server, and have NOTHING to do with the user at that point, so far as I know. The only terminal you could pop up a prompt on is the server itself, I'd think.

                      Now, you could have users edit a text or Excel file and enter the dates there. The next scheduled reload would pick it up. But then they're waiting. Also, if the reason you're restricting the dates is that it takes too long to load, loading it every five minutes in case the users have changed the dates would be counterproductive. Eh, I suppose it could detect if the dates changed, and exit if they have not.

                      I suppose you could submit a reload with a macro (which you just said, and I didn't pick up on at first), at which point we could be back to entering variables, but it doesn't seem like that would really be compatible with AccessPoint, in the sense of it running the reload and distribution TASK instead of just a reload. I'd think a straight reload of the copy of the document that AccessPoint creates wouldn't really be what you want.

                      Eh, this isn't really my area of expertise. I should probably just wait for someone else to come up with the answer rather than stabbing wildly in the dark.