6 Replies Latest reply: Feb 24, 2017 10:49 AM by Sunny Talwar RSS

    SUM set analaysis if group contains a certain line

    Matt Patterson

      I have a small data set:

       

      PIDPCODE               PVAL
      2N50£1,000.00
      2B10£100.00
      2P40£500.00
      3B10£100.00
      3P40£500.00
      4B10£100.00
      4P40£500.00

       

       

      I want to have a straight table that shows PID and PCODE and PVAL

       

      Except if a PID has a PCODE of N50 in it, then their B10 needs to be reduced by 5% of the N50 like so:

       

       

      PIDPCODE               PVAL
      2N50£1,000.00
      2B10£50.00
      2P40£500.00
      3B10£100.00
      3P40£500.00
      4B10£100.00
      4P40£500.00

       

       

      how can i do this?