1 Reply Latest reply: Apr 13, 2012 12:10 AM by Fernando Suzuki RSS

    Creating a quick YTD and Monthly total to a field of data

      Hi, i'm new to scripts and Qlikview and have probably a really simple question to ask....here goes.

       

      How can I achieve a monthly total and yearly total quickly and easily to a field containing data i.e.

       

      Account Name         Date           Daily Mileage

       

      Joe Bloggs          01.05.2011     7

      Joe Bloggs          02.05.2011     2

      Joe Bloggs          03.05.2011     13

      Joe Bloggs          06.05.2011     5

      Joe Bloggs          07.06.2011     2

      Joe Bloggs          08.07.2011     5

      Joe Bloggs          09.07.2011     6   etc...etc..

       

      If I wanted to summarise the daily mileage into a monthly then year to date total figure how do I achieve this please?

        • Creating a quick YTD and Monthly total to a field of data
          Fernando Suzuki

          Hi,

           

          I'd recommend you to create a Time Dimension in your script. It'd be something (conceptual) like:

          Mileage:

          load AccountName, Date, DailyMileage

          from xxxx;

           

          Calendar:

          load Date,

                 Month(Date) as Month,

                 Year(Date) as Year;

          load distinct Date

          resident Mileage;

           

          Then, in the layout, you'd create a chart using the Year and Month fields and an expression like sum(DailyMileage).

           

           

          hope this points you in the right direction

          Fernando