Reputation: 1
I have a requirement to make a mtd pareto of defect. I have 4 columns needed: item, qty, share% and defect%. the defect% should be a cumulative percentage. Any help is very much appreciated. thank you.
defect% = itemqty/total volume qty
share% = itemqty/total defect qty
(I would like to sum the share for the current row + share for the previous row.)
total defect itemqty 16
total volume itemqty 13
sample: item itemqty total volume qty
hardware 7 /16
Locked 5/16+sharepct of hardware
corroded 4/16+sharepct of locked
below is a sample data:
month model item itemqty volumeqty
===============================================
2016(1) Jan P6 Locked 1 1
2016(1) Jan P6 Locked 1 0
2016(1) Jan P6 Locked 1 1
2016(1) Jan P6 Locked 1 1
2016(1) Jan P5 Locked 1 1
2016(1) Jan P6 hardware 1 1
2016(1) Jan P6 hardware 1 0
2016(1) Jan P6 hardware 1 1
2016(1) Jan P6 hardware 1 1
2016(1) Jan P5 hardware 1 1
2016(1) Jan P5 hardware 1 0
2016(1) Jan P5 hardware 1 1
2016(1) Jan P6 corroded 1 1
2016(1) Jan P6 corroded 1 1
2016(1) Jan P6 corroded 1 1
2016(1) Jan P5 corroded 1 1
Upvotes: 0
Views: 351
Reputation: 25142
A very similar thread discusses cumulative sums and percentages here:
Spotfire Custom Expression : Calculate (Num/Den) Percentages
You are going to want to use something similar to:
Sum(If(trim([model])="P6",[itemqty])) then Sum([Value]) over (AllPrevious([Axis.Rows]))
Upvotes: 0