1 Reply Latest reply: Mar 7, 2013 11:46 AM by jagan mohan rao appala RSS

    Why doesnt this resident load work???

      main:
      LOAD Meter_Reading_Date,
        if(Meter_Reading_Date>='01/04/2012' and Meter_Reading_Date<='31/03/2013','12/13',
        if(Meter_Reading_Date>='01/04/2011' and Meter_Reading_Date<='31/03/2012','11/12',
        if(Meter_Reading_Date>='01/04/2010' and Meter_Reading_Date<='31/03/2011','10/11',
        if(Meter_Reading_Date>='01/04/2009' and Meter_Reading_Date<='31/03/2010','09/10',
        if(Meter_Reading_Date>='01/04/2008' and Meter_Reading_Date<='31/03/2009','08/09'))))) as Read_Year, 
           Equipment_Number,
           Device,
           Places_Before_Decimal_Point_In_Meter_Reading as Reading
      FROM
      [D:\Qlik View\Reports\DATA QVD'S\main.qvd]
      (qvd)
      where Exists(Equipment_Number)
      ;

      res:
      load Read_Year as [08/09],
      if(FirstSortedValue(Reading,-Meter_Reading_Date)-FirstSortedValue(Reading,Meter_Reading_Date)<0,
      FirstSortedValue(Reading,-Meter_Reading_Date)-FirstSortedValue(Reading,Meter_Reading_Date)+9999,
      FirstSortedValue(Reading,-Meter_Reading_Date)-FirstSortedValue(Reading,Meter_Reading_Date)) as oheightonine
      resident main

      where [08/09]='08/09'
      ;