I have a report I am building in BI studio pulling data from a SQL server. This is puzzling to me, but I'm sure I can write a sql statement to accomplish what I need.
I have an order - say 92857 which has 4 depts it goes through in the plant 10, 20, 30, 40
each dept gives a total parts when it is finished - 10 - 1500, 20 - 1450, 30- 1250, 40 - 0
I need to take the last sequence number that isn't zero (in this case 30 - 1250) and put that figure into another box on the report for a comparison to another field that is pulled from somewhere else. If I sum it - it gives me a total of the 10, 20, 30, 40. Can a sql statement do this saying basically if 40 = 0 then put the amount of 30 in the box, or if 40=0 and 30=0 then put the 20 amount in the box - you get what i'm saying?
Start Free Trial