5 Replies Latest reply: Mar 13, 2013 11:02 AM by Maurice Bruns RSS

    Creating Buckets in the Load Script

      My Objective is to plot the Lag time on a chart; expressing the frequency of the data in buckets - which would represent the number of months between the Claim Date and a Purchase Date.

       

      I have already made a pre-calculation in the SQL that provide the number of days between Claim and the Purchase. This is now called LTDays,

       

      My next step in the script was to convert the LTDays intoa month figure - which would look like: (LTDays/365*12)

       

       

      This is my intended bucket script - but it doesn't seem to work.

       

      //Script for LTMonths

      LOAD

           (LTDays/365*12) as Lt Months

       

      Resident SynergyCases;

       

      CASE  if (LTMonths) =>0 AND <=1 THEN "0-1"

        if (LTMonths) =>2 AND <=3 THEN "2-3"

        if (LTMonths) =>4 AND <=5 THEN "4-5"

        if (LTMonths) =>6 AND <=7 THEN "6-7"

        if (LTMonths) =>8 AND <=9 THEN "8-9"

        if (LTMonths) =>10 AND <=11 THEN "10-11"

        if (LTMonths) =>12 AND <=13 THEN "12-13"

        if (LTMonths) =>14 AND <=15 THEN "14-15"

        if (LTMonths) =>16 AND <=17 THEN "16-17"

        if (LTMonths) =>18 AND <=19 THEN "18-19"

        if (LTMonths) =>20 AND <=21 THEN "20-21"

        if (LTMonths) =>22 AND <=23 THEN "22-23"

        if (LTMonths) =>24 THEN "24+"

       

        ELSE "Unknown"

        END as BUCKET,

       

       

      Could you please provide some information.