6 Replies Latest reply: Sep 15, 2016 5:26 PM by Travis Young RSS

    Error in Expression ')' expected

    Travis Young

      Receiving Error in Expression ')' expected.

       

      The script I'm trying to run is:

       

      Set calcBidPercent = 'if(FCST = 0, 0, DAMW/FCST)';

      Set calcLoadZeroBid = 'round((FCST*.00*DALMP)+(((fabs(RTMTR)-(FCST*.00))*RTLMP)),0)';

      Set calcDverZeroBid = 'round(((FCST*.00*DALMP)+((FCST*.00)- RTMTR)*RTLMP )*-1,0)';

      //Set calcBidPercentZero = 'if($(calcBidPercent) = 0, 0, if(TYPE = 'LOAD',$(calcLoadZeroBid), $(calcDverZeroBid)))';

      Set calcLoad50Bid = 'round((FCST*.50*DALMP)+(((fabs(RTMTR)-(FCST*.50))*RTLMP)),0)';

      Set calcDver50Bid = 'round(((FCST*.50*DALMP)+((FCST*.50)- RTMTR)*RTLMP )*-1,0)';

      //Set calcBidPercent50 = 'if((calcBidPercent) = 0, 0, if(TYPE = 'LOAD', (calcLoad50Bid), (calcDver50Bid)))';

      Set calcLoad80Bid = 'round((FCST*.80*DALMP)+(((Fabs(RTMTR)-(FCST*.80))*RTLMP)),0)';

      Set calcDver80Bid = 'round(((FCST*.80*DALMP)+((FCST*.80)- RTMTR)*RTLMP )*-1,0)';

      //Set calcBidPercent80 = 'if((calcBidPercent) = 0, 0, if(TYPE = 'LOAD', (calcLoad80Bid),(calcDver80Bid)))';

      Set calcLoad100Bid = 'round((FCST*1*DALMP)+(((fabs(RTMTR)-(FCST*1))*RTLMP)),0)';

      Set calcDver100Bid = 'round(((FCST*1*DALMP)+((FCST*1)- RTMTR)*RTLMP )*-1,0)';

      //Set calcBidPercent100 = 'if((calcBidPercent) = 0, 0, if(TYPE = 'LOAD', (calcLoad100Bid), (calcDver100Bid)))';

      Set calcLoad105Bid = 'round((FCST*1.05*DALMP)+(((fabs(RTMTR)-(FCST*1.05))*RTLMP)),0)';

      Set calcDver105Bid = 'round(((FCST*1.05*DALMP)+((FCST*1.05)- RTMTR)*RTLMP )*-1,0)';

      //Set calcBidPercent105 = 'if((calcBidPercent) = 0, 0, if(TYPE = 'LOAD', (calcLoad105Bid), (calcDver105Bid)))';

      Set calcActualSettle = '(RTMW*RTLMP)+(DAMW*DALMP)';

      Set calcTraderSettle = 'if($(calcBidPercent) = 0,0,$(calcActualSettle))';

      Set calcAmountSavedLoad = '($(calcTraderSettle)- $(calcLoad100Bid)*-1)';

      Set calcAmountSavedDver = '($(calcTraderSettle)-$(calcDver50Bid))';

      //Set calcAmountSaved = 'if((calcBidPercent) = 0,0,if(TYPE = 'LOAD',(calcAmountSavedLoad),(calcAmountSavedDver)';

      Set calcWorstCaseAmountLoad = 'If($(calcLoad80Bid) > $(calcLoad100Bid),$(calcLoad80Bid), $(calcLoad105Bid))';

      Set calcWorstCaseAmountDver = 'if($(calcDverZeroBid) < $(calcDver105Bid), $(calcDverZeroBid),$(calcDver105Bid))';

      //Set calcWorstCase= 'if(TYPE = 'LOAD', (calcWorestCaseAmountLoad), (calcWorestCaseAmountdver))';

      Set calcBestCaseAmountLoad = 'if($(calcLoad80Bid) < $(calcLoad100Bid),$(calcLoad80Bid), $(calcLoad105Bid))';

      Set calcBestCaseAmountDver = 'if($(calcDverZeroBid) > $(calcDver105Bid), $(calcDverZeroBid),$(calcDver105Bid))';

      //Set calcBestCase = 'if(TYPE = 'LOAD', (calcWorestCaseAmountLoad), (calcWorestCaseAmountdver))';

      Set calcBestCaseLoadSaved ='($(calcBestCaseAmountLoad)-$(calcLoad100Bid)*-1)';

      Set calcBestCaseDverSaved ='($(calcBestCaseAmountDver)-$(calcDver50Bid))';

      //Set calcBestCaseSaved= 'if(TYPE = 'Load',(calcBestCaseLoadSaved),(calcBestCaseDverSaved))';

      Set calcWorstCaseLoadSaved ='($(calcWorstCaseAmountLoad)-$(calcLoad100Bid)*-1)';

      Set calcWorstCaseDverSaved ='($(calcWorstCaseAmountDver)-$(calcDver50Bid))';

      //Set calcWorstCaseSaved= 'if(TYPE = 'Load',(calcWorstCaseLoadSaved),(calcWorstCaseDverSaved))';

      CalcFinalData:

        Load

        OPDATE, HE, MINUTE, LOCATION, TYPE, FCST, RTMW, RTLMP, RTMTR, DAMW, DALMP,

        $(calcBidPercent) as BidPer,

        if($(calcBidPercent) = 0, 0, if(TYPE = 'LOAD',$(calcLoadZeroBid), $(calcDverZeroBid))) as [0%],

        if($(calcBidPercent) = 0, 0, if(TYPE = 'LOAD',$(calcLoad50Bid), $(calcDver50Bid))) as [50%],

        if($(calcBidPercent) = 0, 0, if(TYPE = 'LOAD',$(calcLoa80Bid), $(calcDver80Bid))) as [80%],

        if($(calcBidPercent) = 0, 0, if(TYPE = 'LOAD',$(calcLoa100Bid), $(calcDver100Bid))) as [100%],

        if($(calcBidPercent) = 0, 0, if(TYPE = 'LOAD',$(calcLoa105Bid), $(calcDver105Bid))) as [105%],

        $(calcActualSettle) as [Actual Settle],

        $(calcTraderSettle) as [Trader Settle],

        if($(calcBidPercent) = 0,0,if(TYPE = 'LOAD',$(calcAmountSavedLoad),$(calcAmountSavedDver))) as [Amount Saved],

        if(TYPE = 'LOAD', $(calcWorstCaseAmountLoad), $(calcWorstCaseAmountDver)) as [Worst Case],

        if(TYPE = 'LOAD', $(calcBesttCaseAmountLoad), $(calcBestCaseAmountDver)) as [Best Case],

        if(TYPE = 'LOAD', $(calcBestCaseLoadSaved),$(calcBestCaseDverSaved)) as [Best Case Saved],

        if(TYPE = 'LOAD', $(calcWorstCaseLoadSaved),$(calcWorstCaseDverSaved)) as [Worst Case Saved]

        Resident FinalData;