4 Replies Latest reply: Oct 3, 2011 9:13 AM by Dennis Hoogenboom RSS

    Help with trigger to show the future data by default.

      Hi All

       

      I have a pivot table which shows the data from start of the year to the end of the year. What I need is this chart by default it should show the future data only.(i,e) DateField >= today(). May I know how to achieve this with the help of trigger?

       

      Thanks

       

      Attitude

        • Help with trigger to show the future data by default.
          Stefan Wühl

          I think you could use a trigger on opening of the document (see document properties trigger) or OnActivateSheet (see sheet properties) to set the DateField to today's date.

           

          For example, go to document properties, triggers. Select an OnOpen event trigger with action Select - Select in field.

          use

          DateField

           

          as field (as is, no equal sign), and

          ='=sum({<Date = {">=$(=today())"}>}1)'

           

          as search expression.

           

          This will affect all objects that are affected by DateField.

           

          Or you make use of a set of additional variables / data island field, with two states: default (today), free selection and use these states within your pivot table object to limit your DateField if requested. Like above, the trigger would set the state to default on Opening of document or activation of sheet.