3 Replies Latest reply: Jan 20, 2016 2:51 PM by Ron Payne RSS

    Fiscal Master Calendar Script Error ')' Expected

    Ron Payne

      Hi All,

       

      I'm attempting to write a fiscal calendar and need a flag for previous and current year and month, but got stuck. I'm getting errors as commented in the below script. Does anybody have any suggestions or syntax changes to make this logic work?

       

       

       

       

      NoConcatenate

      tempFisc2:   //one row table to feed variable values

      LOAD

      FiscalYear,

      FiscalQuarter,

      FiscalMonth

      Resident tempFiscCal

      Where CalendarDate = Date(Now())    //Today's Date >>> should it be Date(Today())?

      ;

       

       

       

      LET v_RP_CFyr = peek('FiscalYear', 0, 'tempFisc2');      //should have a value of '2016', 1st (only) row of above

      LET v_RP_CFQ = peek('FiscalQuarter', 0, 'tempFisc2');

      LET v_RP_CFMo = peek('FiscalMonth', 0, 'tempFisc2');

       

       

       

       

      NoConcatenate

      FiscCal:

      LOAD *,

      FiscalMonth & '-' & FiscalYear as FiscalMonthYear,

      if($(v_RP_CFyr) = FiscalYear, 1,0) as cFYr_Flag,      //says ')' expected

      if(peek('FiscalYear', 0, 'tempFisc2') = FiscalYear, 1, 0) as cFYr_Flag2     //tried this, returns 0 only

      if(v_RP_CFyr = FiscalYear, 1,0) as cFYr_Flag3,      //field not found (due to resident load)

      Resident tempFiscCal;

       

       

       

       

      DROP Table tempFiscCal, tempFisc2;