2 Replies Latest reply: Sep 21, 2018 10:16 AM by Brian Douglas RSS

    Can you use a calculated field as sort criteria in an Aggr() function?

    Brian Douglas

      I'm using the Class() and Aggr() function in concert to get 10 equal OLDPREMIUM groups. The sort criteria for the Aggr() function is a calculated field. I'm getting an invalid dimension error. The set analysis criteria is valid based on other calculated measurements I've done. I suspect you can't use a calculated field as sort criteria in an Aggr() function. Code is below. Any assistance you can provide would be appreciated. Thanks.

       

      =class(

       

      aggr({$<ACCT_YR={"$(vMaxCurYr)"}, ACCT_MO={"<=$(vMaxCurMo)"}>}sum(OLDPREMIUM),

       

      If(Sum(RENLDIF)<>0,

       

      Pow(Sum(NEWPREMIUM)/Sum(OLDPREMIUM),Sum(PRICEDIF)/Sum(RENLDIF)),

       

      Exp(Sum(PRICEDIF)/Sum(OLDPREMIUM)))-1),

       

      sum(OLDPREMIUM)/10)