0 Replies Latest reply: Aug 15, 2012 4:14 PM by Jeremy Fourman RSS

    Datefield - Order By - QVD

    Jeremy Fourman

      Hi all.

       

      Why does the following script allow me to sort properly in the interface via 'Load Order' but when I remove the qualify statements and instead do a NoConcatenate, the order is not proper, it is instead mixed up.

       

      Is there an insert code button I am not seeing for inserting the following script

       

      QUALIFY *;
      tmp:
      LOAD
      PGScoreYearMonth
          ,PGScoreYearQuarter
          ,PGScoreActDate
          ,PGScoreMonth
          ,PGScoreYear
          ,PGScoreQuarter
          ,PGScore50Cutoff
          ,PGScore90Cutoff
          ,PGScoreActScore
          ,PGScorePercentileRank
          ,PGScoreSiteRank
        //  ,PGScoreNValue
          ,PGScoreKey
          ,PGScorePhysMnem
          ,PGScoreSiteMnem
          ,PGScoreDivMnem
          ,PGScorePhysName
          ,PGScoreYear * 100 + PGScoreMonth as PGScoreDatePeriod
      FROM
      [..\Data\QVD\fact_pgscore_export.qvd]
      (qvd)
      ;

      UNQUALIFY *;

      fact_pgscore_export:
      LOAD
      tmp.PGScoreYearMonth as PGScoreYearMonth
          ,tmp.PGScoreYearQuarter as PGScoreYearQuarter
          ,tmp.PGScoreActDate as PGScoreActDate
          ,tmp.PGScoreMonth as PGScoreMonth
          ,tmp.PGScoreYear as PGScoreYear
          ,tmp.PGScoreQuarter as PGScoreQuarter
          ,tmp.PGScore50Cutoff as PGScore50Cutoff
          ,tmp.PGScore90Cutoff as PGScore90Cutoff
          ,tmp.PGScoreActScore as PGScoreActScore
          ,tmp.PGScorePercentileRank as PGScorePercentileRank
          ,tmp.PGScoreSiteRank as PGScoreSiteRank
        //  ,PGScoreNValue
          ,tmp.PGScoreKey as PGScoreKey
          ,tmp.PGScorePhysMnem as PGScorePhysMnem
          ,tmp.PGScoreSiteMnem as PGScoreSiteMnem
          ,tmp.PGScoreDivMnem as PGScoreDivMnem
          ,tmp.PGScorePhysName as PGScorePhysName
          ,tmp.PGScoreDatePeriod as PGScoreDatePeriod
      resident tmp
      where
      tmp.PGScoreActDate <= $(v_pg_date_filter)
      and
      (tmp.PGScoreYear = Year(now(0)) or tmp.PGScoreYear = Year(now(0)) -1 or tmp.PGScoreYear = Year(now(0)) -2)
      order by tmp.PGScoreActDate
      ;

      drop table tmp;