9 Replies Latest reply: Aug 8, 2011 4:35 AM by Mariliis K.-M. RSS

    Price Variance calculation



      I have a following table:


      Screen shot 2011-08-04 at 12.52.34 PM.png

      ArtCode and IVTRansDate are dimensions and following columns expressions.

      GRQty and GRUPrice are data fields and for PriceVariance I used follwing calculation:


      Variable  vFirstUPrice=FirstSortedValue(GRUPrice,GRDate)


      Everything is nice and working when I have one Item (ArtCode) selected. As soon as I have more than one item variable vFirstUPrice is not giving me any value and therefore my PriceVariance is empty.

      I need to get table, where the first GRUPrice is taken and then for next rows variance is calculated according to the first price. I tried using Aggr function also, but did not succeed.


      Any ideas, how it could be done?


      Thanks in advance!