Current Year Guided Learning Hours (CYGLH) Data Definition 2009/2010

A_INYR_EXPECTED_GLH, A_INYR_ACTUAL_GLH, L_INYR_EXPECTED_GLH, L_INYR_ACTUAL_GLH

DATA DEFINITION
1. Actual and Expected Current Year Guided Learning Hours (CYGLH).

PURPOSE
2. To identify the Guided Learning Hours (GLH) carried out in the relevant academic year for each aim, and for the learner.

RELEVANT COLLECTIONS

  • ILR (LR)
  • ILR (UfI)
  • ILR (ASL)

SOURCE DATA
3. The following variables from the ILR Aims dataset and also as derived are used as source data for the calculation of Actual and Expected Current Year Guided Learning Hours.

Field Name Label Dataset
A17 A17 Delivery mode Aims Standard File
A31 A31 Learning actual end date Aims Standard File
A32 A32 Guided learning hours Aims Standard File
A34 A34 Completion status Aims Standard File
A_ACTIVE A_ACTIVE Aim Active for the current academic year Aims Standard File
A27 A27 Learning start date Aims Standard File
A28 A28 Learning planned end date Aims Standard File
TOTACT TOTACT The actual number of days for the aim Aims Standard File
TOTEXP TOTEXP The expected number of days for the aim Aims Standard File

DERIVED VARIABLES AND DATASETS
4. The definition produces the following derived variable(s)

Field Name Label Dataset
A_INYR_ACTUAL_GLH A_INYR_ACTUAL_GLH Aim Actual current year GLH Aims Standard File
L_INYR_ACTUAL_GLH L_INYR_ACTUAL_GLH Actual In Year GLH Learner Standard Files & Aims Standard Files
A_INYR_EXPECTED_GLH A_INYR_EXPECTED_GLH Aim Expected current year GLH Aims Standard File
L_INYR_EXPECTED_GLH L_INYR_EXPECTED_GLH Expected In Year GLH Learner Standard Files & Aims Standard Files

DETAILED DEFINITION

  1. The ILR collects the number of Guided Learning Hours (GLH), (A32), in which it is planned to deliver the learning aim. This figure relates to the GLH for the lifetime of the aim, irrespective of the relevant academic year.

  2. The Current Year Guided Learning Hours (CYGLH) determines those GLH that are relevant to the current academic year from the total GLH, by calculating the ratio of time taken for the aim in the current academic year to the total time taken to complete the aim.

  3. The expected CYGLH for an aim (A_INYR_EXPECTED_GLH) are generally calculated using the Total planned GLH (A32) for the aim multiplied by, the ratio of the current year number of days (Learning planned end date (A28) – Learning start date (A27)) of the aim divided by the total year number of days (TOTEXP or TOTACT) for the aim. Aims where the Activity of the aim for inclusion in analysis is set to not included (using A_ACTIVE) are excluded.
    This calculation is dependent on the following scenarios:
    1. If the aim is not completed the total expected days (TOTEXP) for the learning aim are used. A Start date of 01/08 replaces the start date (A27) if it is before the start of the current year. If the planned end date (A28) is in the current year the planned end date is used, otherwise the date is set to be the end of the academic year 31/07.
    2. If the aim is completed the total actual days (TOTACT) for the learning aim are used. A Start date of 01/08 replaces the start date (A27) if it is before the start of the current year. If the planned end date (A28) is in the current year the planned end date is used, otherwise the date is set to be the end of the academic year 31/07.
    3. If expected CYGLH (A _INYR_EXPECTED _GLH) for the aim calculated exceeds guided learning hours (A32) supplied in the ILR. Cap to equal GLH (A32).
    4. If the learner is absent for the year (A17=4) then the expected CYGLH (A _INYR_ACTUAL _GLH) is set to zero.

    1. The Learner level expected CYGLH (L_INYR_EXPECTED_GLH) is the summation of the aim Expected CYGLH (A_INYR_EXPECTED_GLH) for all the Learners aims.

    2. The actual CYGLH for an aim (A_INYR_ACTUAL_GLH) is generally calculated using the Total planned GLH (A32) for the aim multiplied by, the ratio of the current year number of days (Learning actual end date (A31) – Learning start date (A27)) of the aim divided by the total number of days (TOTACT or TOTEXP) for the aim. Aims where the Activity of the aim for inclusion in analysis is set to not included (using A_ACTIVE) are excluded.
      This calculation is dependent on the following scenarios:
      1. If the aim is completed the total actual days (TOTACT) are used. A Start date of 01/08 replaces the start date (A27) if it is before the start of the current year. If the actual end date (A31) is in the current year the actual end date is used, otherwise the date is set to be the end of the academic year 31/07.
      2. If the aim is not completed and the actual learning end date (A31) is not missing the total expected days (TOTEXP) are used. A Start date of 01/08 replaces the start date (A27) if it is before the start of the current year. If the actual end date (A31) is in the current year the actual end date is used, otherwise the date is set to be the end of the academic year 31/07.
      3. If the aim is not completed and the actual learning end date is missing the current expected in year guided learning hours (A _INYR_EXPECTED _GLH) are used.
      4. If actual CYGLH (A _INYR_ACTUAL _GLH) for the aim calculated exceeds guided learning hours supplied in the ILR (A32). Cap to equal GLH (A32).
      5. If the learner is absent for the year (A17=4) then the actual CYGLH (A _INYR_ACTUAL _GLH) is set to zero.

          1. The Learner level Actual CYGLH (L_INYR_ACTUAL_GLH) is the summation of the aim Actual CYGLH (A_INYR_ACTUAL_GLH) for all the Learners aims.

              CURRENT YEAR GUIDED LEARNING HOURS (CYGLH) SAMPLE CODE

              1. The following pseudo code and SPSS code is provided to illustrate the Current Year Guided Learning Hours (CYGLH) data definition.

              A_INYR_EXPECTED_GLH

              2. The following table shows the steps required to derive A_INYR_EXPECTED_GLH

              Step Condition Action/Action if true Action if false
              1 Does A_ACTIVE = 1 Then go to 2. Set A_INYR_EXPECTED_GLH=0
              2 Is A34 <> 2 Go to 3 Go to 7
              3 Is A27 < 01 August current academic year Go to 4 Go to 5
              4 Is A28 >= 01 August current academic year and A28<=31 July current academic year Set A_INYR_EXPECTED_GLH = ((difference in days between A28 and the 1 August current academic year)/TOTEXP) multiplied by A32
              Go to 5
              Set A_INYR_EXPECTED_GLH = ((difference in days between 31 July and the 1 August current academic year)/TOTEXP) multiplied by A32
              Then go to 5
              5 Is A27 >= 1 August current academic year Go to 6 Go to step 12 
              6 Is A28 >= 01 August current academic year and A28<=31 July current academic year Set A_INYR_EXPECTED_GLH = ((difference in days between A28 and A27)/TOTEXP) multiplied by A32
              Then go to 7
              Set A_INYR_EXPECTED_GLH = ((difference in days between 31 July and A27)/TOTEXP) multiplied by A32
              Then go to 7
              7 Does A34 = 2 Go to 8 Go to 12
              8 Is A27 < 1 August current academic year Go to 9 Go to 10
              9 Is A28 >= 01 August current academic year and A28<=31 July current academic year Set A_INYR_EXPECTED_GLH = ((difference in days between A28 and the 1 August current academic year)+1/TOTACT)*A32.
              Then go to 10
              Set A_INYR_EXPECTED_GLH = ((difference in days between 31 July and the 1 August current academic year)+1/TOTACT)*A32
              Then go to 10
              10 Is A27 >= 1 August current academic year Go to 11 Go to 12
              11 Is A28 >= 01 August current academic year and A28<=31 July current academic year Set A_INYR_EXPECTED_GLH = ((difference in days between A28 and A27)+1/TOTACT)*A32.
              Then go to 12.
              Set A_INYR_EXPECTED_GLH = ((difference in days between 31 July and A27)+1/TOTACT)*A32
              Then go to 12.
              12 Does A_INYR_EXPECTED >A32 Set A_INYR_EXPECTED_GLH = A32
              Then go to 13
              Go to 13
              13 Does A17 = 6 Set A_INYR_EXPECTED_GLH = 0  

              Step Condition Action/Action if true Action if false
              1 Does A_INYR_EXPECTED_GLH contain a value None Set A_INYR_EXPECTED_GLH = -1

              3. The following SPSS code illustrates how to derive A_INYR_EXPECTED_GLH

              MATCH FILES /FILE=’..aims file’
               /TABLE=’………..learner file’
               /BY L01 L03.

              /* CYGLH ROUTINE***.
              /* There are two CYGLHs, expected and actual,
              /* The expected CYGLH is equal to the expected time spent on the aim in the current year divided by the total expected time to be spent on the aim, multiplied by the total GLH for that aim.
              /* Follows a similar methodology to previous years, but doesn't use census dates
              /* Uses the dates for the current academic year, i.e. 1 Aug to 31 July.

              comp A_InYr_Expected_GLH=-1.

              comp totexp=datedif(a28, a27, “days”)+1.
              comp totact=datedif(a31, a27, “days”)+1.

              do if A_Active=1.

              /* Sandwich courses. Modify the total expected duration if the sandwich course is greater than the period 365 days,/* assumes that they have spent some time on work experience, i.e. not with the provider.

               do if A17=4 and totexp>365.
               comp totexp=totexp-rnd(totexp/3).
               comp totact=totact-rnd(totact/3).
              end if.

              end if.

              /* Expected CYGLH.

                 /* When the aim hasn’t been completed the total expected days are used,
                 /* but when the aim has been completed, the total actual days are used.

               do if A34<>2.
                 /* If the start date is before the start of the current year, used 1/8 in the calculation.
                do if A27<date.dmy(1,8,current academic year).
                 /* If the expected end date is in the current year use expected end date, if not use 31/7.
                 do if A28>=date.dmy(1,8,current academic year) and A28<=date.dmy(31,7,current academic year+1).
                 comp A_InYr_Expected_GLH=((datedif(A28,date.dmy(1,8,current academic year),”days”)+1)/totexp)*A32.
                 else.
                 comp A_InYr_Expected_GLH=((datedif(date.dmy(31,7,current academic year+1),date.dmy(1,8,current academic year),”days”)+1)/totexp)*A32.
                 end if.
                else.  /* If the start date is within the current year use that in the calculation.
                 do if A28>=date.dmy(1,8,current academic year) and A28<=date.dmy(31,7,current academic year+1).
                 comp A_InYr_Expected_GLH=((datedif(A28,A27,”days”)+1)/totexp)*A32.
                 else.
                 comp A_InYr_Expected_GLH=((datedif(date.dmy(31,7,current academic year+1),A27,”days”)+1)/totexp)*A32.
                End if.
               End if.
              Else.  /* aim has been completed so the total actual days are used.
                do if A27<date.dmy(1,8,current academic year).
                 do if A28>=date.dmy(1,8,current academic year) and A28<=date.dmy(31,7,current academic year+1).
                 comp A_InYr_Expected_GLH=((datedif(A28,date.dmy(1,8,current academic year),”days”)+1)/totact)*A32.
                 else.
                 comp A_InYr_Expected_GLH=((datedif(date.dmy(31,7,current academic year+1),date.dmy(1,8,current academic year,),”days”)+1)/totact)*A32.
                 end if.
                else.
                 do if A28>=date.dmy(1,8,current academic year) and A28<=date.dmy(31,7,current academic year+1).
                 comp A_InYr_Expected_GLH=((datedif(A28,A27,”days”)+1)/totact)*A32.
                 else.
                 comp A_InYr_Expected_GLH=((datedif(date.dmy(31,7,current academic year+1),A27,”days”)+1)/totact)*A32.
                 End if.
                End if.
               End if.

              if A_InYr_Expected_GLH>a32 A_InYr_Expected_GLH =A32.

                 /* If the aim is set to absent for the year then both expected and actual are set to zero.
               do if A17=6.
               comp A_InYr_Expected_GLH=0.
               end if.

              End if.

              RECODE A_INYR_EXPECTED_GLH (SYSMIS=-1)



              4. The following SQL code illustrates how to derive A_INYR_EXPECTED_GLH:

              --only execute only part 1 first, then only part 2

              --Part 1

              select

                    L01, L03, A05
                    , case when A_ACTIVE=1 and A17=4 and TOTEXP>365 then TOTEXP-ROUND(TOTEXP/3,0) else TOTEXP end as TOTEXP
                    , case when A_ACTIVE=1 and A17=4 and TOTEXP>365 then TOTACT-ROUND(TOTACT/3,0) else TOTACT end as TOTACT

                   into #totact_totexp

              from
                   (
                   select

                         L01, L03, A05
                         , datediff(dd,A27,A31)+1 as TOTACT
                         , datediff(dd,A27,A28)+1 as TOTEXP
                         , A_ACTIVE, A17

                   from

                        MISVS001.LSC_MI_db_pub.dbo.ILR0910_L01_AIMS
                   )T

              --Part 2


              select

                    L01, L03, A05
                    , case when max(A_INYR_EXPECTED_GLH_qry)>max(A32) then max(A32)
                    when max(A17)=6 or max(A_ACTIVE)<>1 then 0
                    else max(A_INYR_EXPECTED_GLH_qry) end as A_INYR_EXPECTED_GLH_q

              from
                   (
                   select

                         A.L01, A.L03, A.A05, A_ACTIVE, A32, A17
                         , case when A_ACTIVE=1 and A34<>2 and A27<'1 august 2009' and A28>='1 august 2009' and A28<='31 july 2010' then (datediff(dd,'1 august 2009',A28)/(TOTEXP*1.0))*A32
                         when A_ACTIVE=1 and A34<>2 and A27<'1 august 2009' and (A28<'1 august 2009' or A28>'31 july 2010') then (datediff(dd,'1 august 2009','31 july 2010')/(TOTEXP*1.0))*A32
                         when A_ACTIVE=1 and A34<>2 and A27>='1 august 2009' and A28>='1 august 2009' and A28<='31 july 2010' then (datediff(dd,A27,A28)/(TOTEXP*1.0))*A32
                         when A_ACTIVE=1 and A34<>2 and A27>='1 august 2009' and (A28<'1 august 2009' or A28>'31 july 2010') then (datediff(dd,A27,'31 july 2010')/(TOTEXP*1.0))*A32
                         when A_ACTIVE=1 and A34=2 and A27<'1 august 2009' and A28>='1 august 2009' and A28<='31 july 2010' then ((datediff(dd,'1 august 2009',A28)+1)/(TOTACT*1.0))*A32
                         when A_ACTIVE=1 and A34=2 and A27<'1 august 2009' and (A28<'1 august 2009' or A28>'31 july 2010') then ((datediff(dd,'1 august 2009','31 july 2010')+1)/(TOTACT*1.0))*A32
                         when A_ACTIVE=1 and A34=2 and A27>='1 august 2009' and A28>='1 august 2009' and A28<='31 july 2010' then ((datediff(dd,A27,A28)+1)/(TOTACT*1.0))*A32
                         when A_ACTIVE=1 and A34=2 and A27>='1 august 2009' and (A28<'1 august 2009' or A28>'31 july 2010') then ((datediff(dd,A27,'31 july 2010')+1)/(TOTACT*1.0))*A32
                         end as A_INYR_EXPECTED_GLH_qry
               

                   from
                        MISVS001.LSC_MI_db_pub.dbo.ILR0910_L01_AIMS A

                        join

                        #totact_totexp B

                             on A.L01=B.L01 and A.L03=B.L03 and A.A05=B.A05

                   )T

              group by

                   L01, L03, A05

              order by

                   L01, L03, A05


              L_INYR_EXPECTED_GLH

              5. The following table shows the steps required to derive L_INYR_EXPECTED_GLH

              Step Condition Action/Action if true Action if false
              1 (Aggregate)
              Where the Provider (L01) and Learner (L03) are the same.
              Set L_INYR_EXPECTED_GLH= sum(A_INYR_EXPECTED_GLH).  Go to 2

              Step Condition Action/Action if true Action if false 1 Does L_INYR_EXPECTED_GLH contain a value None Set L_INYR_EXPECTED_GLH = -1

              6. The following SPSS code illustrates how to derive L_INYR_EXPECTED_GLH.

              agg out *
                 /break=l01 l03
                 /l_InYr_Expected_GLH=sum(A_InYr_Expected_GLH).

              RECODE L_INYR_EXPECTED_GLH (SYSMIS=-1).



              7. The following SQL code illustrates how to derive L_INYR_EXPECTED_GLH:

              select

                    L01, L03, count(A05) as aims
                    , sum(A_INYR_EXPECTED_GLH) as L_INYR_EXPECTED_GLH

              from

                   LR_AIMS

              group by

                    L01, L03


              A_INYR_ACTUAL_GLH

              8. The following table shows the steps required to derive A_INYR_ACTUAL_GLH

              Step Condition Action/Action if true Action if false
              1 Does A_ACTIVE = 1 Then go to 2. Set A_INYR_ACTUAL_GLH to 0
              2 Is A34 = 2 Go to 3 Go to 7
              3 Is A27 < 01 August current academic year Go to 4 go to 5
              4 Is A31 >= 01 August current academic year and A31 <= 31 July current academic year Set A_INYR_ACTUAL_GLH = ((difference in days between A31 and the 1 August current academic year)+1/TOTACT)*A32.
              Then go to 5
              Set A_INYR_EXPECTED_GLH = ((difference in days between 31 July and the 1 August current academic year+1/TOTACT)*A32
              Then go to 5
              5 Is A27 >= 1,8,current academic year Go to 6  
              6 Is A31 >= 01 August 06 and A31<=31 July current academic year Set A_INYR_ACTUAL_GLH = ((difference in days between A31 and A27)+1/TOTACT)*A32.
              Then go to 7
              Set A_INYR_ACTUAL_GLH = ((difference in days between 31 July and A27)+1/TOTACT)*A32
              Then go to 7
              7 Does A34 <> 2 Go to 8 Go to 13
              8 Is A31 Not Missing Go to 9 Go to 13
              9 Is A27 < 01 August current academic year Go to 10
              10 Is A31 >= 01 August current academic year and A31 <= 31 July current academic year Set A_INYR_ACTUAL_GLH = ((difference in days between A31 and the 1 August current academic year)+1/TOTEXP)*A32.
              Then go to 11
              Set A_INYR_ACTUAL_GLH = ((difference in days between A31 and the 1 August current academic year)+1/TOTEXP)*A32.Then go to 11
              11 Is A27 >= 1,8,current academic year go to 12 Go to 13
              12 Is A31 >= 01 August 06 and A31<=31 July current academic year Set A_INYR_ACTUAL_GLH = ((difference in days between A31 and A27)+1/TOTEXP)*A32.Then go to 13. Set A_INYR_ACTUAL_GLH = ((difference in days between 31 July and A27)+1/TOTEXP)*A32Then go to 13.
              13 Is A31 Missing Set A_INYR_ACTUAL_GLH = Set A_INYR_EXPECTED_GLHThen go to 14 Then go to 14
              14 Does A_INYR_ACTUAL_GLH >A32 Set A_INYR_ACTUAL_GLH = A32Then got to 15 Go to 15
              15 Does A17 = 6 Set A_INYR_ACTUAL_GLH = 0  

              Step Condition Action/Action if true Action if false
              1 Does A_INYR_ACTUAL_GLH contain a value None Set A_INYR_ACTUAL_GLH = -1

              9. The following SPSS code illustrates how to derive A_INYR_ACTUAL_GLH.

              MATCH FILES /FILE=’..aims file’
               /TABLE=’………..learner file’
               /BY L01 L03.

              /*  CYGLH ROUTINE***.
              /* There are two CYGLHs, expected and actual,
              /* The actual CYGLH is equal to the actual time spent on the aim in the current year divided by the total actual time spent on the aim, multiplied by the total GLH for that aim.
              /* Follows a similar methodology to previous years, but doesn't use census dates
              /*  Uses the dates for the current academic year, i.e. 1 Aug to 31 July.

              comp A_InYr_Actual_GLH=0.

              comp totexp=datedif(a28, a27, “days”)+1.
              comp totact=datedif(a31, a27, “days”)+1.

              do if A_Active=1.

              /*  Sandwich courses. Modify the total expected duration if the sandwich course is greater than the period 365 days,
              /*   assumes that they have spent some time on work experience, i.e. not with the provider.

               do if A17=4 and totexp>365.
               comp totact=totact-rnd(totact/3).
               comp totact=totact-rnd(totact/3).
              end if.
               end if.

              /*  Actual CYGLH.

                /* For cases where the aim has been completed total actual days are used.
               do if A34=2.
                /*  If the start date is before the start of the current year, used 1/8 in the calculation.
                do if A27<date.dmy(1,8,current academic year).
                /*  If the actual end date is in the current year use actual end date, if not use 31/7.
                 do if A31>=date.dmy(1,8,current academic year) and A31<=date.dmy(31,7,current academic year+1).
                 comp A_InYr_Actual_GLH=((datedif(A31,date.dmy(1,8,current academic year),”days”)+1)/totact)*A32.
                 else. /*  If the start date is within the current year use that in the calculation.
                 comp A_InYr_Actual_GLH=((datedif(date.dmy(31,7,current academic year+1),date.dmy(1,8,current academic year),”days”)+1)/totact)*A32.
                 end if.
                else.
                 do if A31>=date.dmy(1,8,current academic year) and A31<=date.dmy(31,7,current academic year+1).
                 comp A_InYr_Actual_GLH=((datedif(A31,A27,”days”)+1)/totact)*A32.
                 else.
                 comp A_InYr_Actual_GLH=((datedif(date.dmy(31,7,current academic year+1),A27,”days”)+1)/totact)*A32.
                 End if.
                End if.
               else.  /*  For cases where they haven’t completed use the total expected days instead
                /*  For cases where there is an actual end date.
                do if not MISSING (A31).
                 do if A27<date.dmy(1,8,current academic year).
                  do if A31>=date.dmy(1,8,current academic year) and A31<=date.dmy(31,7,current academic year+1).
                  comp A_InYr_Actual_GLH=((datedif(A31,date.dmy(1,8,current academic year),”days”)+1)/totexp)*A32.
                  else.
                  comp A_InYr_Actual_GLH=((datedif(date.dmy(31,7,current academic year+1),date.dmy(1,8,current academic year),”days”)+1)/totexp)*A32.
                  end if.
                 else.
                  do if A31>=date.dmy(1,8,current academic year) and A31<=date.dmy(31,7,current academic year+1).
                  comp A_InYr_Actual_GLH=((datedif(A31,A27,”days”)+1)/totexp)*A32.
                  else.
                  comp A_InYr_Actual_GLH=((datedif(date.dmy(31,7,current academic year+1),A27,”days”)+1)/totexp)*A32.
                  End if.
                 End if.
                Else. /*  For cases where there isn’t an actual end date and they haven’t completed then actual = expected.
                 comp A_InYr_Actual_GLH=A_InYr_Expected_GLH.
                End if.
               end if.

              if A_InYr_Actual_GLH>a32 A_InYr_Actual_GLH =A32.

                /*  If the aim is set to absent for the year then both expected and actual are set to zero.
               do if A17=6.
               comp A_InYr_Actual_GLH=0.
              end if.

              RECODE A_InYr_Actual_GLH (SYSMIS=-1)

              End if.

              RECODE A_INYR_EXPECTED_GLH (SYSMIS=-1)



              10. The following SQL code illustrates how to derive A_INYR_ACTUAL_GLH:

              --only execute only part 1 first, then only part 2

              --Part 1
              select

                    L01, L03, A05
                    , case when A_ACTIVE=1 and A17=4 and TOTEXP>365 then TOTEXP-ROUND(TOTEXP/3,0) else TOTEXP end as TOTEXP
                    , case when A_ACTIVE=1 and A17=4 and TOTEXP>365 then TOTACT-ROUND(TOTACT/3,0) else TOTACT end as TOTACT

                    into #totact_totexp

              from
                   (
                   select

                         L01, L03, A05
                         , datediff(dd,A27,A31)+1 as TOTACT
                         , datediff(dd,A27,A28)+1 as TOTEXP
                         , A_ACTIVE, A17

                   from

                        LR_Aims
                   )T

              --Part 2

              select

                    L01, L03, A05
                    , case when A_INYR_ACTUAL_GLH_qry>A32) then A32
                    when A17=6 or A_ACTIVE<>1 then 0
                    else A_INYR_ACTUAL_GLH_qry end as A_INYR_ACTUAL_GLH

              from
                   (
                   select

                         A.L01, A.L03, A.A05, A_ACTIVE, A32, A17
                         , case when A_ACTIVE=1 and A34<>2 and A27<'1 august 2009' and A31>='1 august 2009' and A31<='31 july 2010' then (datediff(dd,'1 august 2009',A31)+1/TOTEXP*1.0)*A32
                         when A_ACTIVE=1 and A34<>2 and A27<'1 august 2009' and (A31<'1 august 2009' or A31>'31 july 2010') then (datediff(dd,'1 august 2009','31 july 2010')+1/TOTEXP*1.0)*A32
                         when A_ACTIVE=1 and A34<>2 and A27>='1 august 2009' and A31>='1 august 2009' and A31<='31 july 2010' then (datediff(dd,A27,A31)+1/TOTEXP*1.0)*A32
                         when A_ACTIVE=1 and A34<>2 and A27>='1 august 2009' and (A31<'1 august 2009' or A31>'31 july 2010') then (datediff(dd,A27,'31 july 2010')+1/TOTEXP*1.0)*A32
                         when A_ACTIVE=1 and A34=2 and A27<'1 august 2009' and A31>='1 august 2009' and A31<='31 july 2010' then (datediff(dd,'1 august 2009',A31)+1/TOTACT*1.0)*A32
                         when A_ACTIVE=1 and A34=2 and A27<'1 august 2009' and (A31<'1 august 2009' or A31>'31 july 2010') then (datediff(dd,'1 august 2009','31 july 2010')+1/TOTACT*1.0)*A32
                         when A_ACTIVE=1 and A34=2 and A27>='1 august 2009' and A31>='1 august 2009' and A31<='31 july 2010' then (datediff(dd,A27,A31)+1/TOTACT*1.0)*A32
                         when A_ACTIVE=1 and A34=2 and A27>='1 august 2009' and (A31<'1 august 2009' or A31>'31 july 2010') then (datediff(dd,A27,'31 july 2010')+1/TOTACT*1.0)*A32
                         when A31 is null then A_INYR_EXPECTED_GLH
               end as A_INYR_ACTUAL_GLH
               

                   from
                        LR_Aims A
                        join
                        #totact_totexp B
                             on A.L01=B.L01 and A.L03=B.L03 and A.A05=B.A05
                   )T

              order by

                   L01, L03, A05


              L_INYR_ACTUAL_GLH

              11. The following table shows the steps required to derive L_INYR_EXPECTED_GLH

              Step Condition Action/Action if true Action if false
              1 (Aggregate)
              Where the Provider (L01) and Learner (L03) are the same.
              Set L_INYR_ACTUAL_GLH= sum(A_INYR_ACTUAL_GLH)  Go to 2

              Step Condition Action/Action if true Action if false
              1 Does L_ INYR_ACTUAL_GLH contain a value None Set L_ INYR_ACTUAL_GLH = -1

              12. The following SPSS code illustrates how to derive L_INYR_ACTUAL_GLH.

              agg out *
                /brea=l01 l03
                /l_A_InYr_Actual_GLH=sum(A_InYr_Actual_GLH).

              RECODE l_InYr_Actual_GLH (SYSMIS=-1)



              13. The following SQL code illustrates how to derive L_INYR_ACTUAL_GLH:

              select

                    L01, L03, count(A05) as aims
                    , sum(A_INYR_ACTUAL_GLH) as L_INYR_ACTUAL_GLH

              from

                   LR_AIMS

              group by

                    L01, L03



              Date last modified: 21 March 2011