4 Replies Latest reply: Sep 7, 2011 10:54 AM by Sunil Chauhan RSS

    Difference Between 2 Records in a Field

    Darren Ball

      Hi,

      I have 3 fields, Date, Country and TotalPageViews.

       

      The total page views for the same 5 countries are recorded for each day. So, each day has 5 countries, each with 1 page view value.

       

      I would like to create a table that in column1 has date, column 2 has country, column 3 will have the total page views, but column 4 gives the number of new page views for each country for each day i.e. the difference bewteen the total page views on a day and the total page views on the previous day.

       

      So, the table will look something like

       

      Date     Country     Total Views     Daily Page Views

      1/9/11   CountryA          50                    50

      2/9/11   CountryA          55                    5

      3/9/11   CountryA          63                    8

      4/9/11   CountryA          70                    7

      1/9/11   CountryB          40                    40

      2/9/11   CountryB          41                    1

      3/9/11   CountryB          49                    8

      4/9/11   CountryB          55                    6